🎅 HOHOHO! 85%OFF Flatlogic Generator! 🎄Build your custom CRM, ERP, or SaaS app with full code ownership this Christmas 🎁

Where is process.env.NODE_ENV set?

User profile image

Good day Everyone,

I have a "Angular / Node.JS / Mysql / Material design" stack running...

Standard deployment: app.config.ts const hostApi = process.env.NODE_ENV === 'development' ? 'http://localhost' : '';

it always resolves to hostApi is empty....console.log("PE:", process.env.NODE_ENV); always displays production.

Please where is process.env.NODE_ENV set? Why is not even in the build pointing to the correct backend (port 8080)?

Best Regards, Sascha

User profile image

as workaround to get it running....changed the following two lines in app.config.ts:

From: const hostApi = process.env.NODEENV === 'development' ? 'http://localhost' : 'http://localhost'; const portApi = process.env.NODEENV === 'development' ? 8080 : '8080';

To: const hostApi = process.env.NODEENV === 'development' ? 'http://localhost' : ''; const portApi = process.env.NODEENV === 'development' ? 8080 : '';

User profile image

Hello Sascha Contes

We just updated the project to the latest version, update the code from the repository.

Solved