Skip to content

Commit

Permalink
load dotenv lib at start (strapi#6701)
Browse files Browse the repository at this point in the history
* load dotenv lib at start
allows setting STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_LEVEL etc in env file

Signed-off-by: Akash P <aksdevac@gmail.com>

* remove extra if statement

Signed-off-by: Akash P <aksdevac@gmail.com>
Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
  • Loading branch information
imaksp authored and onepointconsulting committed Aug 13, 2020
1 parent b9250be commit abbcfcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/strapi/lib/Strapi.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

// Dependencies.
const dotenv = require('dotenv');

dotenv.config({ path: process.env.ENV_PATH });

const http = require('http');
const path = require('path');
const fse = require('fs-extra');
Expand Down
3 changes: 0 additions & 3 deletions packages/strapi/lib/core/app-configuration/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
'use strict';

const dotenv = require('dotenv');

dotenv.config({ path: process.env.ENV_PATH });
process.env.NODE_ENV = process.env.NODE_ENV || 'development';

const os = require('os');
Expand Down

0 comments on commit abbcfcf

Please sign in to comment.