-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
executable file
·35 lines (23 loc) · 971 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Declare our Module dependencies at the top
*/
var express = require('express'); //express - application framework for node
//fixes long ../../ require calls
//https://gist.github.com/branneman/8048520
process.env.NODE_PATH = '.';
require('module').Module._initPaths();
/**
* Index.js
* The main application entry file.
* Please note that the order of loading is important!
*/
var env = process.env.NODE_ENV || 'local', //get the environemnt var or set as development
config = require('core/config')[env]; //get config based on the specifed environment
console.log('ENVIRONMENT = ' + env); // log out the environment variable to the terminal
// ================================
// === EXPRESS SETUP AND CONFIG ===
// ================================
var parentApp = express(); //Create an express app
require('./core')(parentApp, config); //handles the setup of our application
// expose app as the scope
exports = module.exports = parentApp;