aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat-1 <github@matdoes.dev>2021-04-09 01:15:56 +0000
committermat-1 <github@matdoes.dev>2021-04-09 01:15:56 +0000
commit93860fc217937431fd31a68daf69f3376b960161 (patch)
tree65b38b3fa83b2114b319e62a21c017cb4c60569f
parent2f0d6b32ba72bf8b3c0bfe8668193c956ff9e224 (diff)
downloadskyblock-api-93860fc217937431fd31a68daf69f3376b960161.tar.gz
skyblock-api-93860fc217937431fd31a68daf69f3376b960161.tar.bz2
skyblock-api-93860fc217937431fd31a68daf69f3376b960161.zip
Compiled TS into JS
-rw-r--r--build/index.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/index.js b/build/index.js
index 6d09aca..dad9312 100644
--- a/build/index.js
+++ b/build/index.js
@@ -10,10 +10,10 @@ const express_rate_limit_1 = __importDefault(require("express-rate-limit"));
const express_1 = __importDefault(require("express"));
const app = express_1.default();
exports.debug = false;
-// 500 requests over 5 minutes
+// 200 requests over 5 minutes
const limiter = express_rate_limit_1.default({
windowMs: 60 * 1000 * 5,
- max: 500,
+ max: 200,
skip: (req) => {
return req.headers.key === process.env.key;
},
@@ -23,6 +23,10 @@ const limiter = express_rate_limit_1.default({
}
});
app.use(limiter);
+app.use((req, res, next) => {
+ res.setHeader('Access-Control-Allow-Origin', '*');
+ next();
+});
app.get('/', async (req, res) => {
res.json({ ok: true });
});