Last active
June 20, 2018 16:23
-
-
Save DinoChiesa/3cae5caef303b41238da4886d3a7e487 to your computer and use it in GitHub Desktop.
nodejs hello world
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
const app = require('express')(), | |
bodyParser = require('body-parser'); | |
var gStatus = { | |
version : '20180619-1845' | |
}; | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
app.get('/status', function(request, response) { | |
... | |
}); | |
... | |
const port = process.env.PORT || 5950; | |
const server = app.listen(port, function() { | |
log.setLevel(3); | |
log.write(0, "service version %s listening on port %s", gStatus.version, server.address().port); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment