adding production cors issues fixes
When deploying on a server and everything is up and running, the backend is giving auth / cors errors conserning the ip address requesting the data.
We should be able or create an option to easily update the cors settings or host settings per CLI any ideas?
Hello @LeroySteding! Did you try editing the *_CORS variables the generated .env file?
I did yes, im steps further though but now when setting NODE_ENV=production im getting these:
$ medusa start
{"level":"info","message":"Skipping instrumentation registration. No register function found.","timestamp":"2025-01-28 09:19:34"}
{"level":"info","message":"Connection to Redis in module 'cache-redis' established","timestamp":"2025-01-28 09:19:34"}
{"level":"info","message":"Connection to Redis in module 'event-bus-redis' established","timestamp":"2025-01-28 09:19:34"}
{"level":"info","message":"Locking module: Using \"in-memory\" as default.","timestamp":"2025-01-28 09:19:35"}
{"level":"error","message":"Error starting server","timestamp":"2025-01-28 09:19:36"}
{"level":"error","message":"Could not find index.html in the admin build directory. Make sure to run 'medusa build' before starting the server.","stack":[{"columnNumber":11,"fileName":"/app/node_modules/@medusajs/admin-bundler/dist/index.js","functionName":"serve","lineNumber":1465,"methodName":null,"native":false,"typeName":null},{"columnNumber":28,"fileName":"/app/node_modules/@medusajs/medusa/src/loaders/admin.ts","functionName":"serveProductionBuild","lineNumber":79,"methodName":null,"native":false,"typeName":null},{"columnNumber":3,"fileName":"/app/node_modules/@medusajs/medusa/src/loaders/index.ts","functionName":"async loadEntrypoints","lineNumber":110,"methodName":null,"native":false,"typeName":null},{"columnNumber":31,"fileName":"/app/node_modules/@medusajs/medusa/src/loaders/index.ts","functionName":"async exports.default","lineNumber":170,"methodName":"default","native":false,"typeName":"async exports"},{"columnNumber":59,"fileName":"/app/node_modules/@medusajs/medusa/src/commands/start.ts","functionName":"async internalStart","lineNumber":169,"methodName":null,"native":false,"typeName":null},{"columnNumber":5,"fileName":"/app/node_modules/@medusajs/medusa/src/commands/start.ts","functionName":"async start","lineNumber":293,"methodName":null,"native":false,"typeName":null}],"timestamp":"2025-01-28 09:19:36"}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
When NODE_ENV is not set to production im getting the allowedHosts error from Vite.. Any suggestions on this one?
Maybe we could add skip migration, skip user creation flag with an code change in the entrypoint.sh?