-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6891d04
commit e2273de
Showing
6 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: node app.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
console.log("Hello world!"); | ||
// External dependencies | ||
var express = require( 'express' ); | ||
|
||
|
||
// Dependencies | ||
var environment = require( './app/lib/environment' ); | ||
|
||
|
||
// Local variables | ||
var app = express(); | ||
|
||
|
||
/** | ||
* Initialise | ||
*/ | ||
var init = function init() { | ||
|
||
app.get( '/', function ( req, res ) { | ||
res.send( 'Hello World!' ); | ||
} ); | ||
|
||
var server = app.listen( environment.port, function () { | ||
console.log( 'Example app listening at %s', environment.baseUrl ); | ||
} ); | ||
|
||
console.log( environment ); | ||
|
||
}; | ||
|
||
// Get the party started | ||
init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// External dependencies | ||
var dotenv = require( 'dotenv' ); | ||
|
||
// Local variables | ||
var environmentName = process.env.NODE_ENV || process.env.node_env || 'development'; | ||
|
||
// Use .env file for development and test | ||
if ( environmentName === 'development' || environmentName === 'test' ) { | ||
dotenv.load(); | ||
} | ||
|
||
var environment = { | ||
project: 'ribot API', | ||
name: environmentName, | ||
baseUrl: process.env.BASE_URL, | ||
port: process.env.PORT | ||
}; | ||
|
||
// Exports | ||
module.exports = environment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters