Skip to content

Commit 04c15f8

Browse files
Merge pull request #148 from harshitap1305/harshita/fixes
Add trust proxy setting for production environment
2 parents c73e814 + 0d8965b commit 04c15f8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

backend/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ const positionsRoutes = require("./routes/positionRoutes.js");
1818
const organizationalUnitRoutes = require("./routes/orgUnit.js");
1919
const dashboardRoutes = require("./routes/dashboard.js");
2020
const app = express();
21+
22+
if (process.env.NODE_ENV === "production") {
23+
app.set("trust proxy", 1);
24+
}
25+
2126
app.use(cors({ origin: process.env.FRONTEND_URL, credentials: true }));
2227

2328
// Connect to MongoDB

0 commit comments

Comments
 (0)