Skip to content

Commit f68ddf8

Browse files
authored
Use Sofia.url for CORS configuration (#1057)
1 parent 406c119 commit f68ddf8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

server/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ module.exports = function (app) {
1717
require
1818
);
1919

20-
app.use(cors({ origin: 'http://localhost:5000' }));
20+
// Use `sofiaUrl` only from env or Ember config (no hardcoded fallbacks).
21+
// Load Ember config function with the current environment if provided.
22+
const config = require('../config/environment')(
23+
process.env.EMBER_ENV || process.env.NODE_ENV
24+
);
25+
const sofiaUrl = process.env.SOFIA_URL || config.sofiaUrl;
26+
27+
app.use(cors({ origin: sofiaUrl }));
2128

2229
// Log proxy requests
2330
const morgan = require('morgan');

0 commit comments

Comments
 (0)