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
Percy
Percy2y ago
Project ID: 7dd7217c-8c47-4d87-a1ed-ba42da383cb5
Bfixed
BfixedOP2y ago
7dd7217c-8c47-4d87-a1ed-ba42da383cb5
Brody
Brody2y ago
set the appropriate root directory in the service settings
Bfixed
BfixedOP2y ago
like this /railway.toml
Brody
Brody2y ago
thats a file, not a directory do you know what a directory is?
Bfixed
BfixedOP2y ago
a folder right?
Brody
Brody2y ago
yes
Bfixed
BfixedOP2y ago
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
Brody
Brody2y ago
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
Bfixed
BfixedOP2y ago
Can I do both in the same deploy? meaning like back and front, or it's not possible?
Brody
Brody2y ago
not ideal, youd need two services
Bfixed
BfixedOP2y ago
Yes I know that it's not ideal, it's just for a demo I ussualy do like you said
Brody
Brody2y ago
do two services, one for frontend, one for backend
Bfixed
BfixedOP2y ago
So like create 2 projects in the dashboard and linked them between?
Brody
Brody2y ago
no one project, two services
Bfixed
BfixedOP2y ago
Ahh ok
Brody
Brody2y ago
then in each service youd set the appropriate root directory
Bfixed
BfixedOP2y ago
Ok got it
Bfixed
BfixedOP2y ago
Like this right?
Brody
Brody2y ago
looks about correct
Bfixed
BfixedOP2y ago
thanks, so, sorry to bother again, but now I got another problem
Bfixed
BfixedOP2y ago
That for the frontend
Brody
Brody2y ago
what framework did you do the frontend in
Bfixed
BfixedOP2y ago
React & Typescript with vite Also the backend is in Ts
Brody
Brody2y ago
can i see your repo?
Bfixed
BfixedOP2y ago
Sure
Bfixed
BfixedOP2y ago
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
Brody
Brody2y ago
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.json
Bfixed
BfixedOP2y ago
ok it'll be like this correct? "scripts": { "start": "dist -s -n -L -p $PORT", "dev": "vite", "build": "tsc && vite build", "preview": "vite preview" },
Brody
Brody2y ago
no read again
Bfixed
BfixedOP2y ago
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 $PORT
sh: 1: dist: not found
Brody
Brody2y ago
bruh look this over and carefully compare it to the start command i told you to use
Bfixed
BfixedOP2y ago
🤐 ups Sorry Yahooo it works Thanks
Brody
Brody2y ago
no problem!
Bfixed
BfixedOP2y ago
And again sorry to bother, but unfortunately go for round 2 It's the backend 🙃
Bfixed
BfixedOP2y ago
I put it like you told me
Brody
Brody2y ago
and what errors are you getting
Bfixed
BfixedOP2y ago
This one
Brody
Brody2y ago
what is this little arrow
Brody
Brody2y ago
Bfixed
BfixedOP2y ago
I really dont know 0.0 That doesn't appear in my main project though
Brody
Brody2y ago
well if i cant even click it, then railway wont be able to get that sorted please
Bfixed
BfixedOP2y ago
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
Brody
Brody2y ago
that should be easy enough remember to use environment variables
Bfixed
BfixedOP2y ago
I surely hope so I am a SQL guy 🙂 This is my first project with NoSQL But for the rest much obliged
Brody
Brody2y ago
no problem, its what im here for
Bfixed
BfixedOP2y ago
Five stars for you my friend
Want results from more Discord servers?
Add your server