R
Railway•13mo ago
Manuel kbza

has taken too long to respond.

Hi. I just uploaded my Monorepo and it's working good on logs. But when I try to access to: https://tidyfreshv2-production.up.railway.app:7452/ it says "Has taken to long to respond" I'm new on this, so if you can help me would be great. My stack is nestjs and nextjs for my monorepo builded with Turbopack
51 Replies
Percy
Percy•13mo ago
Project ID: 93040d23-f028-4588-bd14-9ae6bb951e4d
Manuel kbza
Manuel kbzaOP•13mo ago
ProjectID: 93040d23-f028-4588-bd14-9ae6bb951e4d
Brody
Brody•13mo ago
you can only access your app over port 443 https://tidyfreshv2-production.up.railway.app/
Manuel kbza
Manuel kbzaOP•13mo ago
And what about if I'm trying to submit a mono repo. Do I need to have 2 differents projects, right?
Brody
Brody•13mo ago
one project, two railway services
Manuel kbza
Manuel kbzaOP•13mo ago
Cool, thanks for your help buddy. I really appreciate it 🙂
Brody
Brody•13mo ago
no problem, what two apps do you have if you dont mind me asking
Manuel kbza
Manuel kbzaOP•13mo ago
I have frontend (nextjs) and backend (nestjs). On my local I was using docker and monorepo with Turbo. Also, I have postgres Db
Brody
Brody•13mo ago
the package.json in the root would need to have two sets of scripts, one set of build and start scripts that build and start only the frontend, and another set that only build and start the backend, typically that would look something like this
"build:frontend": "the command to build only the frontend here",
"start:frontend": "the command to start only the frontend here",
"build:backend": "the command to build only the backend here",
"start:backend": "the command to build only the backend here"
"build:frontend": "the command to build only the frontend here",
"start:frontend": "the command to start only the frontend here",
"build:backend": "the command to build only the backend here",
"start:backend": "the command to build only the backend here"
then in each railway service youd set the appropriate build and start commands in the service settings, for instance the frontend service would have the build command set to npm run build:frontend and the start command set to npm run start:frontend turbo provides a way to build and start specific apps, i dont know that syntax for that off the top of my head, but that should give you a good understanding
Manuel kbza
Manuel kbzaOP•13mo ago
Hi, boss (again) @Brody . I just initialize another service just with the backend. Again, everything is good on logs but the same issue is taken so long to respond.
Brody
Brody•13mo ago
you still cant use anything but port 443 when connecting to your service externally
Manuel kbza
Manuel kbzaOP•13mo ago
I manually put 443 on environment variables. https://apitidy-production.up.railway.app/ Logs: [Nest] 42 - 11/14/2023, 3:47:31 AM LOG [NestApplication] Nest application successfully started +3ms Application is running on: http://[::1]:443
Manuel kbza
Manuel kbzaOP•13mo ago
I literally followed this guide: // 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"); } my main.ts is following this documentation :/
Brody
Brody•13mo ago
what do your new deploy logs look like?
Manuel kbza
Manuel kbzaOP•13mo ago
No description
Brody
Brody•13mo ago
looks like your app is running on 127.0.0.1 instead of 0.0.0.0
Manuel kbza
Manuel kbzaOP•13mo ago
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as cors from 'cors';
import * as dotenv from 'dotenv';


dotenv.config();

async function bootstrap() {
const app = await NestFactory.create(AppModule);


app.use(cors({
origin: 'http://localhost:3000'
}));


const port = process.env.PORT || 3000;

await app.listen(port, "0.0.0.0");
console.log(`Application is running on: ${await app.getUrl()}`);
}
bootstrap();
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as cors from 'cors';
import * as dotenv from 'dotenv';


dotenv.config();

async function bootstrap() {
const app = await NestFactory.create(AppModule);


app.use(cors({
origin: 'http://localhost:3000'
}));


const port = process.env.PORT || 3000;

await app.listen(port, "0.0.0.0");
console.log(`Application is running on: ${await app.getUrl()}`);
}
bootstrap();
this is my main.ts, just in case I need to change something
Brody
Brody•13mo ago
think that looks good, send me the url please
Brody
Brody•13mo ago
it works?
Manuel kbza
Manuel kbzaOP•13mo ago
Nop :c
Brody
Brody•13mo ago
No description
Manuel kbza
Manuel kbzaOP•13mo ago
wtf, for me does not work. Maybe I need to clear cache Let me try, thanks boss for your help
Brody
Brody•13mo ago
its always cache lol
Manuel kbza
Manuel kbzaOP•13mo ago
haha
Brody
Brody•13mo ago
does it work now?
Manuel kbza
Manuel kbzaOP•13mo ago
Not for me, same issue. :/
No description
Brody
Brody•13mo ago
what url are you trying
Brody
Brody•13mo ago
are you sure you arent trying to specify a port?
Manuel kbza
Manuel kbzaOP•13mo ago
100% sure
No description
Brody
Brody•13mo ago
try a different browser?
Manuel kbza
Manuel kbzaOP•13mo ago
I tried brave, edge and chrome. I will try to restart my router just to make sure
Brody
Brody•13mo ago
try a vpn too?
Manuel kbza
Manuel kbzaOP•13mo ago
Tried vpn still same issue lol
Brody
Brody•13mo ago
vpn to my location, us-east
Manuel kbza
Manuel kbzaOP•13mo ago
I just changed the region and it works. Why is that issue? I also need to be work on my region :/
Brody
Brody•13mo ago
the region on the vpn?
Manuel kbza
Manuel kbzaOP•13mo ago
I just changed to USA
Brody
Brody•13mo ago
whats your region?
Manuel kbza
Manuel kbzaOP•13mo ago
Dominican Republic Is this for any particular issue?
Brody
Brody•13mo ago
no one has reported any outages
Manuel kbza
Manuel kbzaOP•13mo ago
That's weird. I tested using other locations like UK, Spain and everything works. But, when I turn off the vpn does not work anymore. I send the link to some friends from my country as well just to see if on their end works and it doesn't lol
Brody
Brody•13mo ago
could this be an isp firewall?
Manuel kbza
Manuel kbzaOP•13mo ago
That could be the issue, somtehing that I can do on my end to solve it?
Brody
Brody•13mo ago
if its an isp firewall you dont have many options, use a vpn is about it
Manuel kbza
Manuel kbzaOP•13mo ago
Definitively I just tried with another ISP and it works. But, my ISP is the most popular ISP on my country 😦
Brody
Brody•13mo ago
thats not ideal
Manuel kbza
Manuel kbzaOP•13mo ago
any recommendation? I don't want to use other service than railway, I really like this service lol
Brody
Brody•13mo ago
i dont really know what to tell you, theres not much railway can do for you if your isp is blocking you
Want results from more Discord servers?
Add your server