Created
November 12, 2017 00:27
-
-
Save moorthi07/d11644166373d3c1daf1407f09f84857 to your computer and use it in GitHub Desktop.
dpd server.js
This file contains hidden or 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
// require deployd | |
var deployd = require('deployd'); | |
var PORT=2403; | |
// configure database etc. | |
var server = deployd({ | |
port: process.env.PORT || PORT, | |
env: process.env.ENV || 'development', | |
db: { | |
//Connection UN / PWD should not contain an '@' included. | |
// connectionString: 'mongodb://localhost:27017/mydb' | |
/ } | |
}); | |
// start the server | |
server.listen(); | |
// debug | |
server.on('listening', function() { | |
console.log("APAIBOT DPD Server is listening on port: " , PORT ); | |
}); | |
// Deployd requires this | |
server.on('error', function(err) { | |
console.error(err); | |
process.nextTick(function() { // Give the server a chance to return an error | |
process.exit(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment