R
Railway•16mo ago
wisentini

Can't deploy Angular application

I'm trying to deploy this front-end project of mine (https://github.com/raioxcape/raioxcape/tree/main/front-end), but I'm always getting the "Application failed to respond" screen after successfully deploying. I'm using ng build as the build command and ng serve as the start command, with only one service variable, that is NODE_ENV=production. What is wrong?
Solution:
1. install serve with npm i serve 2. set your start script to serve dist/front-end -s -n -L -p $PORT...
Jump to solution
17 Replies
Percy
Percy•16mo ago
Project ID: 499c211e-ee48-4f8d-9cbf-b5569a601a8d
wisentini
wisentini•16mo ago
499c211e-ee48-4f8d-9cbf-b5569a601a8d
Brody
Brody•16mo ago
ng serve starts a development server, not fit to run on railway
wisentini
wisentini•16mo ago
So what should I use instead?
Brody
Brody•16mo ago
what folder does ng build output to?
wisentini
wisentini•16mo ago
to dist/front-end
Solution
Brody
Brody•16mo ago
1. install serve with npm i serve 2. set your start script to serve dist/front-end -s -n -L -p $PORT
wisentini
wisentini•16mo ago
I'll try that No need for ng before the command you provided?
Brody
Brody•16mo ago
correct
wisentini
wisentini•16mo ago
Ok
Brody
Brody•16mo ago
make sure you are specifying build and start commands in the package.json and not in the service settings!!
wisentini
wisentini•16mo ago
Alright I'll try all this later and I'll let you know what happened after
Brody
Brody•16mo ago
sounds good!
wisentini
wisentini•16mo ago
It worked! The only problem is that the icon is not showing Like, the icon on the tab My app logo
Brody
Brody•16mo ago
I'm sure that would be an easy fix for you 🙂
wisentini
wisentini•16mo ago
Yeah, for sure! Thanks @Brody!!
Brody
Brody•16mo ago
no problem!
Want results from more Discord servers?
Add your server