I'm assuming there's something simple I'm missing because I'm new to this tool.
I'm using "nx": "14.8.2",
I have apps/api/.env
with NX_API_PORT=5000
This works when I use the api:serve
command, but run the built code from a dev build to test it with node dist/apps/api/main.js
the api port is undefined and my || fallbackPort
is used.
I tried some of the other .env
file naming patterns from their docs but no luck.
I would rather use the environment.ts
files from apps/app-name/src/environments
, but I have a libs/shared/api/data-access
lib that exports methods to call my apps/api
, so this lib needs the apps/api
env vars to build the base url differently between dev and prod.