R
Railwayβ€’17mo 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β€’17mo ago
Project ID: dcc778ee-bff3-412f-bc0c-450c139c5224
xbisa
xbisaOPβ€’17mo ago
dcc778ee-bff3-412f-bc0c-450c139c5224
Brody
Brodyβ€’17mo ago
serve dist/stepping-stones-triple-p -s -n -L -p $PORT
serve dist/stepping-stones-triple-p -s -n -L -p $PORT
xbisa
xbisaOPβ€’17mo ago
Where is $PORT comming from?
Brody
Brodyβ€’17mo ago
railway automatically
xbisa
xbisaOPβ€’17mo ago
I'll give it a try I'm deploying Same issue No It's working Thanks man πŸ™
Brody
Brodyβ€’17mo ago
no problem!
xbisa
xbisaOPβ€’17mo ago
I have the same issue with my Nest app should I create a new post for it?
xbisa
xbisaOPβ€’17mo 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β€’17mo ago
show me the bootstrap() code please do not specify a port in that url
xbisa
xbisaOPβ€’17mo 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β€’17mo 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
xbisaOPβ€’17mo ago
It still shows me "Application failed to respond"
xbisa
xbisaOPβ€’17mo 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β€’17mo ago
according to your code above, you are not doing that
xbisa
xbisaOPβ€’17mo ago
the only difference is that my environment variable is named: API_PORT
Brody
Brodyβ€’17mo ago
that is incorrect, you do not need to set your own port with environment variables, use PORT like the doc shows
xbisa
xbisaOPβ€’17mo ago
Oh I see It's playing now Thanks again πŸ™
Brody
Brodyβ€’17mo ago
no problem
Want results from more Discord servers?
Add your server