#NestJS multi app monorepo different .env

5 messages · Page 1 of 1 (latest)

topaz fable
#

Hi, i have a nestjs monorepo, i'm wondering how can i separate .env files to each app?

i want something like this:
apps/
-- api-one/
--- .env
-- api-two/
--- .env
-- api-three/
--- .env

#

NestJS multi pp monorepo different .env

#

NestJS multi app monorepo different .env

sharp socket
#

that approach looks good to me
what's your question?

quartz socket
#

How to make @nestjs/config read the correct .env file? when I execute 'npm run start:dev api-one', the nestjs/config search for the .env file on root of the monorepo, not in the root of 'api-one' (i'm using monorepo mode workspace as show in https://docs.nestjs.com/cli/monorepo)