9 months ago
Hi everyone !
I'm just a newbbie, studying a little bit of backend for a simple fullstack API, using MERN stack (React + Vite).
Everything works fine locally, event interactions with MongoDB Atlas.
My project structure is :
/backend
├── db
├── models
├── routes
├── .env
└── server.js
/frontend
├── public
├── src
├── components
├── App.css
├── index.css
├── App.jsx
├── main.jsx
├── Caddyfile
├── index.html
├── nixpacks.toml
├── postcss.config.js
├── tailwind.config.js
├── vite.config.js
├── .env
└── package.json
Both backend and frontend Railway services are deployed successfully.
Deploy logs for backend show connection to Mongo database is successful, but a warn mentions
npm WARN config production Use --omit=dev instead.
Deploy logs for frontend show "admin endpoint disabled" and "automatic HTTPS is completely disabled for server".
I have configured my frontend environment variable in Railway ("Settings" / "Variables" tag) to fetch queries with URL generated by Railway after backend deployment : VITE_BACKEND_URL = "https://... up.railway.app ".
I have tried
app.listen( PORT , "0.0.0.0" ,
( console.log (`Server listening on port ${PORT}`)) ) ;
in my backend "server.mjs" entry point file as indicated in link provided (https://docs.railway.app/guides/fixing-common-errors).
But are "mjs" extensions valid in Railway context ?
I have also tried to add "Caddyfile" and "nixpacks.toml" files found in this discussion , but I haven't modified anything for cors (as everything is fine locally).
Does anyone have suggestions or ideas please ?
Thank you.
9 Replies
9 months ago
But are "mjs" extensions valid in Railway context ?
Of course, file extensions doesn't have anything to do with the platform though.
application failed to respond
Unless I'm missing it, you didn't mention what app is returning this error?
9 months ago
Thank you for your reply and explanations. The app returning this error is "user_connection_MERN_project". I created a service just for tests : test-fullstack_deploymt_frontend
9 months ago
This is the frontend link.
9 months ago
no problem Brody. Thank you anyway. I think I'll try another platform : it is too complicate for me here.
Status changed to Closed brody • 9 months ago