Browse Source

organize environment settings

Yuki Takei 8 years ago
parent
commit
b9fb4ea856
3 changed files with 1 additions and 25 deletions
  1. 1 1
      config/env.prod.js
  2. 0 20
      lib/crowi/helpers.js
  3. 0 4
      lib/crowi/index.js

+ 1 - 1
config/env.prod.js

@@ -1,5 +1,5 @@
 module.exports = {
 module.exports = {
-  // logging settings
+  NODE_ENV: 'production',
   DEBUG: [
   DEBUG: [
     'crowi:crowi',
     'crowi:crowi',
   ].join(),
   ].join(),

+ 0 - 20
lib/crowi/helpers.js

@@ -1,20 +0,0 @@
-/**
- * @author: @AngularClass
- * @author: Yuki Takei <yuki@weseek.co.jp>
- */
-
-var path = require('path');
-
-const EVENT = process.env.npm_lifecycle_event || '';
-
-// Helper functions
-var ROOT = path.resolve(__dirname, '..');
-
-function hasProcessFlag(flag) {
-  return process.argv.join('').indexOf(flag) > -1;
-}
-
-var root = path.join.bind(path, ROOT);
-
-exports.hasProcessFlag = hasProcessFlag;
-exports.root = root;

+ 0 - 4
lib/crowi/index.js

@@ -9,7 +9,6 @@ var debug = require('debug')('crowi:crowi')
   , mongoose    = require('mongoose')
   , mongoose    = require('mongoose')
 
 
   , eazyLogger = require('eazy-logger')
   , eazyLogger = require('eazy-logger')
-  , helpers = require('./helpers')
   , models = require('../models')
   , models = require('../models')
   ;
   ;
 
 
@@ -47,9 +46,6 @@ function Crowi(rootdir, env) {
 
 
   this.env = env;
   this.env = env;
   this.node_env = this.env.NODE_ENV || 'development';
   this.node_env = this.env.NODE_ENV || 'development';
-  if (helpers.hasProcessFlag('prod') || helpers.hasProcessFlag('production')) {
-    this.node_env = process.env.NODE_ENV = 'production';
-  }
 
 
   this.port = this.env.PORT || 3000;
   this.port = this.env.PORT || 3000;