example frontend-backend communication

This commit is contained in:
2025-09-24 20:19:58 +02:00
parent bf9ae5f01f
commit bba4044eaf
13 changed files with 412 additions and 33 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ app.use(loggingService.requestLoggingMiddleware());
app.use((req, res, next) => {
const origin = req.headers.origin;
const allowedOrigins = ['http://localhost:3000', 'http://localhost:3001', 'http://localhost:8080'];
const allowedOrigins = ['http://localhost:3000', 'http://localhost:3001', 'http://localhost:8080', process.env.FRONTEND_URL];
if (!origin || allowedOrigins.includes(origin)) {
res.setHeader('Access-Control-Allow-Origin', origin || '*');