aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/index.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/index.ts b/src/index.ts
index 63c803c..def7aff 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -20,14 +20,13 @@ const csrf = csurf({ cookie: true });
// Rate limiting
const rateLimiter = rateLimit({
- windowMs: 1 * 60 * 1000, // 1 minute
- max: 40, // Limit each IP to 40 requests per `window` (here, per 1 minutes)
- standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
- legacyHeaders: false, // Disable the `X-RateLimit-*` headers
+ windowMs: 1 * 60 * 1000, // 1 minute
+ max: 40, // Limit each IP to 40 requests per `window` (here, per 1 minutes)
+ standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
+ legacyHeaders: false, // Disable the `X-RateLimit-*` headers
});
app.use(rateLimiter);
-
// The API
app.use('/api/v1/', api);
@@ -40,14 +39,14 @@ app.use('/public', express.static(path.join(__dirname, 'public'))); // Set stati
/* ROUTING */
app.get('/', csrf, (req: Request, res: Response) => {
- res.render('index', { csrfToken: req.csrfToken() });
+ res.render('index', { csrfToken: req.csrfToken() });
});
app.get('/about', csrf, (req: Request, res: Response) => {
- res.render('about');
+ res.render('about');
});
// Start the server
const port = env.PORT || 2000;
app.listen(port, () => {
- console.log(`Server is listening on port ${port}`);
-}); \ No newline at end of file
+ console.log(`Server is listening on port ${port}`);
+});