Need help regarding nestjs+postgres deployment

Stack Overflow
Unable to connect railway.app postgres to nestjs application
I have a NestJS application where app.module.ts has the following information import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { AppController } from...
9 Replies
Percy
Percy8mo ago
Project ID: 1d273f0b-fde3-4c52-8939-0603176da3c2
hidden whale
hidden whale8mo ago
1d273f0b-fde3-4c52-8939-0603176da3c2
Brody
Brody8mo ago
can you connect to railway postgres locally?
hidden whale
hidden whale8mo ago
all good, I was trying to load the env variables the wrong way! i'll update the stackoverflow answer I was missing the import { ConfigModule } from '@nestjs/config'; in nestjs
Brody
Brody8mo ago
for future reference, stack overflow questions about railway go unanswered most of the time, just ask in discord
hidden whale
hidden whale8mo ago
i''ll still answer the question on stackoverflow, hoping it would help someone in the future. and i'll keep the discord channel in mind.
Brody
Brody8mo ago
sounds good
hidden whale
hidden whale8mo ago
Stack Overflow
Unable to connect railway.app postgres to nestjs application
I have a NestJS application where app.module.ts has the following information import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { AppController } from...
Brody
Brody8mo ago
I'll be honest i don't like the fact that your solution involves storing your database url in a plaintext .env file, I've seen far too many users database urls in .env files, and I don't even work for railway!! you should forgo the .env file and use the railway cli with railway run that will temporarily inject the service variables into a new environment and then will run the given command https://docs.railway.app/guides/cli#local-development