We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8757ad5 commit bd854bdCopy full SHA for bd854bd
server/main.js
@@ -29,7 +29,16 @@ async function main() {
29
30
// allow origin https://localhost
31
app.use((_req, res, next) => {
32
- res.header('Access-Control-Allow-Origin', 'https://localhost');
+ const allowedOrigins = [
33
+ 'https://preview--acode-code-hub.lovable.app', // temp, for dev only
34
+ 'http://localhost:8080', // temp, for dev only
35
+ 'https://localhost',
36
+ ];
37
+ const origin = req.headers.origin;
38
+
39
+ if (allowedOrigins.includes(origin)) {
40
+ res.header('Access-Control-Allow-Origin', origin);
41
+ }
42
// allow content-type
43
res.header('Access-Control-Allow-Headers', 'Content-Type');
44
next();
0 commit comments