Skip to content

Commit

Permalink
feat: allow all origins to request config
Browse files Browse the repository at this point in the history
  • Loading branch information
typotter committed Mar 3, 2025
1 parent 594c954 commit 9893d20
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 273 deletions.
2 changes: 2 additions & 0 deletions package-testing/testing-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
"lint-fix": "eslint --fix"
},
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.20.0"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/node": "^22.5.1",
"eslint": "^9.9.1",
Expand Down
6 changes: 5 additions & 1 deletion package-testing/testing-api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as path from 'path';

import express from 'express';
import routes from './routes';
import cors from 'cors';

import * as fs from 'fs';
import { setDataFile } from './ufc/data';
Expand All @@ -15,8 +16,11 @@ class App {
this.middlewares();
this.routes();
}

options: cors.CorsOptions = {
origin: ['*'],
};
middlewares() {
this.server.use(cors());
this.server.use(express.json());
}

Expand Down
Loading

0 comments on commit 9893d20

Please sign in to comment.