Fix CORS configuration: Add frontend:806 to allowed origins and set FRONTEND_URL

This commit is contained in:
TheMaddax 2025-10-28 07:55:30 -06:00
parent a3104df159
commit 6df5bd193a
2 changed files with 3 additions and 2 deletions

View file

@ -25,3 +25,4 @@ MAX_FILE_SIZE=10485760
NODE_ENV=development
PORT=3001
LOG_LEVEL=info
FRONTEND_URL=https://mad-lawsuit.org

View file

@ -58,8 +58,8 @@ app.use(helmet({
// CORS configuration
app.use(cors({
origin: process.env.NODE_ENV === 'production'
? process.env.FRONTEND_URL
: ['http://localhost:3000', 'http://frontend:3000'],
? [process.env.FRONTEND_URL, 'http://frontend:806', 'http://localhost:806']
: ['http://localhost:3000', 'http://localhost:806', 'http://frontend:806', 'http://frontend:3000'],
credentials: true,
}));