2 years ago
Hello guys,so i am creating a fitness website and i wuant to host it online just for myseelf to test it out so i can have a prespective on how it would work if i was in the user side,i decied to use railway to host the backend ,and netlify for the frontend ,but i am having some problems to connect the backend unfortonely,i think i have connected the database but i dont am really sure if i did it right,can someone help ?
69 Replies
2 years ago
what issues are you running into?
2 years ago
please share your repo
2 years ago
you dont have a package.json and package-lock.json in that backend folder
2 years ago
yes those are node specific, without those nixpacks wont know what to do with this backend project
2 years ago
you need them in the backend folder too and they need to be in github
2 years ago
create the files in the backend folder
2 years ago
you need them in the backend folder
2 years ago
^
2 years ago
considering its current broken, you cant make it worse, you need them, there is no two ways about that
what is going on now ? Error: Cannot find module 'express'
Require stack:
-
/app/server.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object. (/app/server.js:1:17)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/app/server.js' ]
}
Node.js v18.20.2
2 years ago
you need to have all your needed dependences in your package.json
2 years ago
well an example would be express for one
if i install express will railway know ? or even github form my machine ?
2 years ago
it will install it because its listed in your package.json
2 years ago
yes it says active, now you need to generate a domain
2 years ago
2 years ago
this will be the domain for your backend
2 years ago
you need to generate a public domain
2 years ago
yes
2 years ago
your frontend code needs to call the domain, it would not have anything to do with netlify specifically
2 years ago
railway is running the server, not netlify
2 years ago
uh sure, i dont really understand the question / your english, sorry
imagine if i deploy the backend in railway,i wont need to use the terminal later ?
2 years ago
i guess
i am trying to host my frontend in here but it is appearing me this error 404
2 years ago
we can't provide support for platforms that arent railway
2 years ago
i don't see how that is productive to the conversation, going to close this thread out.



