File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ WORKDIR /app
1717ENV NODE_ENV="production"
1818ENV BACKEND_URL="https://mindmeld-87770296075.europe-west1.run.app"
1919ENV PORT=3000
20- ENV FRONTEND_URL ="https://mindmeldtool.netlify.app"
20+ ENV FRONTEND_URLS ="https://mindmeldtool.netlify.app,https://nexus-tool.com "
2121ENV CLOUD_SQL_CONNECTION_NAME="mindmeld-backend:europe-west1:mindmeld-db"
2222
2323COPY package*.json ./
@@ -26,4 +26,4 @@ RUN npm ci --only=production
2626COPY --from=builder /app/dist ./dist
2727
2828EXPOSE 3000
29- CMD ["node" , "dist/index.js" ]
29+ CMD ["node" , "dist/index.js" ]
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ interface Config {
22 nodeEnv : string ;
33 port : number ;
44 backendUrl : string ;
5- frontendUrl : string ;
5+ frontendUrls : string [ ] ;
66 openAIKey : string ;
77 googleClientId : string ;
88 db : {
@@ -33,7 +33,7 @@ const config: Config = {
3333 nodeEnv : environment ,
3434 port : parseInt ( process . env . PORT || '3001' , 10 ) ,
3535 backendUrl : process . env . BACKEND_URL || 'http://localhost' ,
36- frontendUrl : process . env . FRONTEND_URL || 'http://localhost:3000' ,
36+ frontendUrls : ( process . env . FRONTEND_URLS || 'http://localhost:3000' ) . split ( ',' ) . map ( url => url . trim ( ) ) ,
3737 openAIKey : process . env . OPENAI_API_KEY || '' ,
3838 googleClientId : process . env . GOOGLE_CLIENT_ID || '' ,
3939 db : {
@@ -45,4 +45,4 @@ const config: Config = {
4545 } ,
4646} ;
4747
48- export default config ;
48+ export default config ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const app = express();
1818const server = http . createServer ( app ) ;
1919const io = new Server ( server , {
2020 cors : {
21- origin : config . frontendUrl ,
21+ origin : config . frontendUrls ,
2222 methods : [ "GET" , "POST" ]
2323 }
2424} ) ;
@@ -100,5 +100,5 @@ io.on('connection', (socket) => {
100100server . listen ( config . port , ( ) => {
101101 console . log ( `Server running at ${ config . backendUrl } :${ config . port } ` ) ;
102102 console . log ( `Environment: ${ config . nodeEnv } ` ) ;
103- console . log ( `Allowing CORS for origin : ${ config . frontendUrl } ` ) ;
103+ console . log ( `Allowing CORS for origins : ${ config . frontendUrls . join ( ', ' ) } ` ) ;
104104} ) ;
You can’t perform that action at this time.
0 commit comments