Skip to content
This repository was archived by the owner on May 16, 2026. It is now read-only.

Commit 5def298

Browse files
committed
אפשור cors מFRONTEND_URL
1 parent f0d6df3 commit 5def298

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require('express-async-errors');
77
require('colors');
88
const fs = require('fs');
99
const path = require('path');
10+
const cors = require('cors');
1011

1112
require('module-alias/register');
1213
const setAndCheckConfig = require('./setup');
@@ -20,6 +21,7 @@ if (process.env.PROD) {
2021
app.use(morgan('dev'));
2122
}
2223

24+
app.use(cors(process.env.FRONTEND_URL));
2325
app.use(express.json());
2426
app.use(express.urlencoded({ extended: false }));
2527
app.use(cookieParser());

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"cheerio": "^1.0.0-rc.12",
2222
"colors": "^1.4.0",
2323
"cookie-parser": "^1.4.6",
24+
"cors": "^2.8.5",
2425
"deep-email-validator": "^0.1.21",
2526
"ejs": "^3.1.8",
2627
"express": "^4.18.2",
@@ -58,4 +59,4 @@
5859
"@controllers": "./src/controllers",
5960
"@routes": "./src/routes"
6061
}
61-
}
62+
}

0 commit comments

Comments
 (0)