?? cors zimbirtisi
Signed-off-by: Ferit Yiğit BALABAN <fyb@fybx.dev>
This commit is contained in:
parent
3786657cf2
commit
1e5c5c4a7a
8
index.js
8
index.js
@ -29,6 +29,14 @@ app.use(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
app.use((err, req, res, next) => {
|
||||||
|
if (err.message.startsWith('Origin')) {
|
||||||
|
res.status(403).json({ error: err.message });
|
||||||
|
} else {
|
||||||
|
next(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 2 requests per 5 minutes
|
// 2 requests per 5 minutes
|
||||||
const limiter = rateLimit({
|
const limiter = rateLimit({
|
||||||
windowMs: 5 * 60 * 1000,
|
windowMs: 5 * 60 * 1000,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user