Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Last active December 19, 2015 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/5910236 to your computer and use it in GitHub Desktop.
Save brianjmiller/5910236 to your computer and use it in GitHub Desktop.
Simple service based on Express
/node_modules

Install dependencies with:

npm update

Start server with:

./server.js 
{
"name": "SimpleService",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.x"
}
}
#!/usr/bin/env node
var express = require("express"),
app = express();
app.use(express.bodyParser());
app.get("/somePath", function (req, res) {
var json = {
someKey: "val"
};
res.json(json);
});
console.log("Starting...");
app.listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment