R
Railwayβ€’16mo ago
xbisa

Can't deploy Angular app from my GitHub repo

I'm trying to deploy Angular app from my GitHub repo, but I always get "Application failed to respond". My start script is set to "serve dist/stepping-stones-triple-p -s -n -L -p 4200". What can the problem be?
21 Replies
Percy
Percyβ€’16mo ago
Project ID: dcc778ee-bff3-412f-bc0c-450c139c5224
xbisa
xbisaβ€’16mo ago
dcc778ee-bff3-412f-bc0c-450c139c5224
Brody
Brodyβ€’16mo ago
serve dist/stepping-stones-triple-p -s -n -L -p $PORT
serve dist/stepping-stones-triple-p -s -n -L -p $PORT
xbisa
xbisaβ€’16mo ago
Where is $PORT comming from?
Brody
Brodyβ€’16mo ago
railway automatically
xbisa
xbisaβ€’16mo ago
I'll give it a try I'm deploying Same issue No It's working Thanks man πŸ™
Brody
Brodyβ€’16mo ago
no problem!
xbisa
xbisaβ€’16mo ago
I have the same issue with my Nest app should I create a new post for it?
xbisa
xbisaβ€’16mo ago
thanks for link, I'll look into it I can see my Nest app is running but it times out when I send a request e.g. https://stepping-stones-triple-p-api-production.up.railway.app:3000/municipalities
Brody
Brodyβ€’16mo ago
show me the bootstrap() code please do not specify a port in that url
xbisa
xbisaβ€’16mo ago
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.enableCors({ preflightContinue: false, allowedHeaders: ['content-type', 'authorization'], methods: ['GET', 'POST', 'DELETE', 'PATCH'], origin: ${process.env.APP_URL}:${process.env.APP_PORT}, }); const config = new DocumentBuilder() .setTitle('Stepping Stones Triple P') .setDescription('The Stepping Stones Triple P API description') .setVersion('1.0') .addBearerAuth() .addTag('Stepping Stones Triple P') .build(); const document = SwaggerModule.createDocument(app, config); SwaggerModule.setup('api', app, document); const port = process.env.API_PORT || 3000; await app.listen(port, '0.0.0.0'); } bootstrap();
Brody
Brodyβ€’16mo ago
the port will always be 443, and the browser knows that since you are using https please take another look at this https://docs.railway.app/troubleshoot/fixing-common-errors#node--nest
xbisa
xbisaβ€’16mo ago
It still shows me "Application failed to respond"
xbisa
xbisaβ€’16mo ago
I'm doing pricesily this // Use PORT provided in environment or default to 3000 const port = process.env.PORT || 3000; // Listen on port and 0.0.0.0 async function bootstrap() { // ... await app.listen(port, "0.0.0.0"); }
Brody
Brodyβ€’16mo ago
according to your code above, you are not doing that
xbisa
xbisaβ€’16mo ago
the only difference is that my environment variable is named: API_PORT
Brody
Brodyβ€’16mo ago
that is incorrect, you do not need to set your own port with environment variables, use PORT like the doc shows
xbisa
xbisaβ€’16mo ago
Oh I see It's playing now Thanks again πŸ™
Brody
Brodyβ€’16mo ago
no problem
Want results from more Discord servers?
Add your server