标签:conf RoCE dea change mat ini tar username file
To stop having to change configuration settings in production code and to stop secure information like usernames and password being stored in source control its a good idea to use local configuration files.
This lesson explains how to read in the local configuration, how to perform a check to make sure the required variables are present and how you might communicate an example configuration file to other team members.
const dotenv = require(‘dotenv‘).config({ path: ‘variables.env‘ }); const colors = require(‘colors‘); const setup = require(‘./setup‘); // run setup, to access anything from variables.env, you only need process.env.USER try{ setup.init() }catch(err){ console.error(`Critical Error - Server Stoppping ${err}`); process.exit(); }
console.log(‘Server Started‘);
[Node.js] Setup Local Configuration with Node.js Applications
标签:conf RoCE dea change mat ini tar username file
原文地址:https://www.cnblogs.com/Answer1215/p/9296043.html