Skip to content

Instantly share code, notes, and snippets.

@kmassada
Created January 6, 2016 17:34
Show Gist options
  • Save kmassada/bedc9c12b43280ebb103 to your computer and use it in GitHub Desktop.
Save kmassada/bedc9c12b43280ebb103 to your computer and use it in GitHub Desktop.
node's hello world
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.get("/", function(req, res) {
res.status(200).send("hello world");
});
var server = app.listen(3222, function () {
var host = server.address().address;
var port = server.address().port;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment