fix(cors): removed useless features (#37)

This commit is contained in:
psyko-gh
2024-10-05 16:18:37 +02:00
committed by GitHub
parent 89826744ce
commit a446511252
3 changed files with 2149 additions and 809 deletions

2949
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,6 @@
"@eslint/js": "^9.11.1",
"@semantic-release/github": "^11.0.0",
"@types/cookie": "^0.6.0",
"@types/cors": "^2.8.17",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.13",
"@types/minimist": "^1.2.5",

View File

@@ -1,5 +1,4 @@
import express from 'express';
import cors from 'cors';
import envVar from '@core/env';
import logger from '@core/log';
import Settings, { getSettings, OnSettingLoadedCallback } from '@core/lib/settings';
@@ -45,13 +44,6 @@ getSettings().watch(configPath, onLoad);
const app = express();
const port = argv.port ?? envVar('PORT', 5056);
const corsOptions = {
origin: [`http://localhost`, `http://localhost:${port}`, `http://127.0.0.1`, `http://127.0.0.1:${port}`],
credentials: true,
exposedHeaders: ['set-cookie'],
};
app.use(cors(corsOptions));
app.use('/api', apiRouter);
app.listen(port, () => {
return logger.info(`Overcrawlrr is listening at http://localhost:${port} `);