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
Project ID:
dcc778ee-bff3-412f-bc0c-450c139c5224
dcc778ee-bff3-412f-bc0c-450c139c5224
Where is $PORT comming from?
railway
automatically
I'll give it a try
I'm deploying
Same issue
No
It's working
Thanks man π
no problem!
I have the same issue with my Nest app
should I create a new post for it?
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
show me the bootstrap() code please
do not specify a port in that url
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();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
It still shows me "Application failed to respond"
please take another look at this
https://docs.railway.app/troubleshoot/fixing-common-errors#node--nest
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");
}according to your code above, you are not doing that
the only difference is that my environment variable is named: API_PORT
that is incorrect, you do not need to set your own port with environment variables, use PORT like the doc shows
Oh I see
It's playing now
Thanks again π
no problem