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
Cookie Consent

By continuing to browse or by clicking 'OK', you agree to the storing of cookies on your device to enhance your site experience and for analytical purposes. To learn more about how we use cookies, please see our cookies policy.