Fix CORS configuration: Add frontend:806 to allowed origins and set FRONTEND_URL
This commit is contained in:
parent
a3104df159
commit
6df5bd193a
2 changed files with 3 additions and 2 deletions
|
|
@ -25,3 +25,4 @@ MAX_FILE_SIZE=10485760
|
|||
NODE_ENV=development
|
||||
PORT=3001
|
||||
LOG_LEVEL=info
|
||||
FRONTEND_URL=https://mad-lawsuit.org
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue