Problem deploying an Node app
I'm trying to deploy a fullstack app, but it's my first time and I don't know what I'm doing wrong
47 Replies
Project ID:
7dd7217c-8c47-4d87-a1ed-ba42da383cb5
7dd7217c-8c47-4d87-a1ed-ba42da383cb5
set the appropriate root directory in the service settings
like this
/railway.toml
thats a file, not a directory
do you know what a directory is?
a folder right?
yes
but how? sorry to be a bother, but my problem is that I got 2 folders one for the backend and another one for the frontend
So I'm really lost in this scenario
yes, set the appropriate root directory in the service settings
if you want to designate that service as the backend, then you set the root directory as /backend
Can I do both in the same deploy? meaning like back and front, or it's not possible?
not ideal, youd need two services
Yes I know that it's not ideal, it's just for a demo
I ussualy do like you said
do two services, one for frontend, one for backend
So like create 2 projects in the dashboard and linked them between?
no
one project, two services
Ahh ok
then in each service youd set the appropriate root directory
Ok got it
Like this right?
looks about correct
thanks, so, sorry to bother again, but now I got another problem
That for the frontend
what framework did you do the frontend in
React & Typescript with vite
Also the backend is in Ts
can i see your repo?
Sure
GitHub
GitHub - Bfix40/ChatBox: A message App that copy the model from sla...
A message App that copy the model from slack and discord - GitHub - Bfix40/ChatBox: A message App that copy the model from slack and discord
open a terminal in frontend and run
npm i serve
then set serve dist -s -n -L -p $PORT
as your start command in the frontends package.jsonok it'll be like this correct?
"scripts": {
"start": "dist -s -n -L -p $PORT",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
no
read again
ok step 1) install serve, check, step 2) set the start command as serve dist -s -n -L -p $PORT
The second part is the one that I don't see where I'm wrong
Oh, one other thing, it's already building
But crash in the deploy
npm WARN config production Use
--omit=dev
instead.
[email protected] start dist -s -n -L -p $PORTsh: 1: dist: not found
bruh
look this over and carefully compare it to the start command i told you to use
🤐 ups
Sorry
Yahooo it works
Thanks
no problem!
And again sorry to bother, but unfortunately go for round 2
It's the backend 🙃
I put it like you told me
and what errors are you getting
This one
what is this little arrow
I really dont know 0.0
That doesn't appear in my main project though
well if i cant even click it, then railway wont be able to
get that sorted please
Yes, wait a minute please
I see that it's a problem with the github repo, I'm going to try to delete it and upload it again to see if it gives me the same error
Finish, it was a problem with a auth
I solved it, and now it is runnig
The only Issue right now is that I have yet to configure my mongo DB XD
that should be easy enough
remember to use environment variables
I surely hope so
I am a SQL guy 🙂
This is my first project with NoSQL
But for the rest much obliged
no problem, its what im here for
Five stars for you my friend