P
P
prolina2020-11-07 22:12:57
Node.js
prolina, 2020-11-07 22:12:57

Is the value from .env undefined?

Hello! In my application on Angular 2+ I have a feedback form. To receive data from this form, I wrote a node.js code using nodemailer. For nodemailer, it was necessary to create variables stored in the .env file, which is in the same folder as server.ts, but for some reason, when outputting to the console, process.env.NODE_VAR has the value undefined.
.env:
NODE_VAR = value
server.ts:
require('dotenv').config();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question