envs
This commit is contained in:
@@ -5,7 +5,11 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node server.js",
|
||||
"dev": "nodemon server.js",
|
||||
"start:dev": "NODE_ENV=dev node -r dotenv/config server.js dotenv_config_path=.env.dev",
|
||||
"start:qa": "NODE_ENV=qa node -r dotenv/config server.js dotenv_config_path=.env.qa",
|
||||
"start:prod": "NODE_ENV=prod node -r dotenv/config server.js dotenv_config_path=.env.prod",
|
||||
"dev": "NODE_ENV=dev nodemon -r dotenv/config server.js dotenv_config_path=.env.dev",
|
||||
"dev:qa": "NODE_ENV=qa nodemon -r dotenv/config server.js dotenv_config_path=.env.qa",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
require('dotenv').config();
|
||||
// Load environment-specific config
|
||||
const env = process.env.NODE_ENV;
|
||||
const envFile = `.env.${env}`;
|
||||
|
||||
require('dotenv').config({
|
||||
path: process.env.DOTENV_CONFIG_PATH
|
||||
});
|
||||
const express = require('express');
|
||||
const cors = require('cors');
|
||||
const bodyParser = require('body-parser');
|
||||
|
||||
Reference in New Issue
Block a user