R
Railway•17mo 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•17mo ago
Project ID: 499c211e-ee48-4f8d-9cbf-b5569a601a8d
wisentini
wisentiniOP•17mo ago
499c211e-ee48-4f8d-9cbf-b5569a601a8d
Brody
Brody•17mo ago
ng serve starts a development server, not fit to run on railway
wisentini
wisentiniOP•17mo ago
So what should I use instead?
Brody
Brody•17mo ago
what folder does ng build output to?
wisentini
wisentiniOP•17mo ago
to dist/front-end
Solution
Brody
Brody•17mo ago
1. install serve with npm i serve 2. set your start script to serve dist/front-end -s -n -L -p $PORT
wisentini
wisentiniOP•17mo ago
I'll try that No need for ng before the command you provided?
Brody
Brody•17mo ago
correct
wisentini
wisentiniOP•17mo ago
Ok
Brody
Brody•17mo ago
make sure you are specifying build and start commands in the package.json and not in the service settings!!
wisentini
wisentiniOP•17mo ago
Alright I'll try all this later and I'll let you know what happened after
Brody
Brody•17mo ago
sounds good!
wisentini
wisentiniOP•17mo ago
It worked! The only problem is that the icon is not showing Like, the icon on the tab My app logo
Brody
Brody•17mo ago
I'm sure that would be an easy fix for you 🙂
wisentini
wisentiniOP•17mo ago
Yeah, for sure! Thanks @Brody!!
Brody
Brody•17mo ago
no problem!
Want results from more Discord servers?
Add your server