Need help regarding nestjs+postgres deployment
Can someone help me in the write direction https://stackoverflow.com/questions/77622563/unable-to-connect-railway-app-postgres-to-nestjs-application
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
Project ID:
1d273f0b-fde3-4c52-8939-0603176da3c2
1d273f0b-fde3-4c52-8939-0603176da3c2
can you connect to railway postgres locally?
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
for future reference, stack overflow questions about railway go unanswered most of the time, just ask in discord
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.
sounds good
I updated the answer on my post https://stackoverflow.com/questions/77622563/unable-to-connect-railway-app-postgres-to-nestjs-application
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...
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