fix(cors): removed useless features (#37)
This commit is contained in:
2949
package-lock.json
generated
2949
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
@@ -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} `);
|
||||
|
||||
Reference in New Issue
Block a user