Skip to content

Commit

Permalink
fix: Replace the use of the WEBFUNC_ENV with the more standard NODE_E…
Browse files Browse the repository at this point in the history
…NV env variable
  • Loading branch information
nicolasdao committed Dec 18, 2017
1 parent a047618 commit e828ce6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/webfunc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const getAppConfig = memoize => {

const getActiveEnv = memoize => {
const appconfig = getAppConfig(memoize)
const processWebFunc = getProcessEnv().WEBFUNC_ENV
const activeEnv = ((appconfig || {}).env || {}).active || processWebFunc
const processWebFunc = getProcessEnv().NODE_ENV
const activeEnv = ((appconfig || {}).env || {}).active || processWebFunc || 'default'
if (activeEnv) {
const env = Object.assign((appconfig.env[activeEnv] || {}), { _name: activeEnv })
return env
Expand Down Expand Up @@ -303,7 +303,7 @@ const serveHttp = (arg1, arg2, arg3) => {
const _supportedHostings = { 'now': true, 'sh': true, 'localhost': true, 'express': true, 'gcp': true, 'aws': true }
const listen = (functionName, port) => {
const _appconfig = getAppConfig() || {}

const env = getActiveEnv()
const hostingType = env.hostingType || 'localhost'
if (!_supportedHostings[hostingType.toLowerCase()])
Expand Down

0 comments on commit e828ce6

Please sign in to comment.