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
Percy12mo ago
Project ID: 1d273f0b-fde3-4c52-8939-0603176da3c2
hidden whale
hidden whaleOP12mo ago
1d273f0b-fde3-4c52-8939-0603176da3c2
Brody
Brody12mo ago
can you connect to railway postgres locally?
hidden whale
hidden whaleOP12mo 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
Brody12mo ago
for future reference, stack overflow questions about railway go unanswered most of the time, just ask in discord
hidden whale
hidden whaleOP12mo 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
Brody12mo ago
sounds good
hidden whale
hidden whaleOP12mo 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
Brody12mo 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
Want results from more Discord servers?
Add your server