Skip to content

Instantly share code, notes, and snippets.

@tbranyen
Created February 21, 2014 23:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbranyen/9145866 to your computer and use it in GitHub Desktop.
Save tbranyen/9145866 to your computer and use it in GitHub Desktop.
var express = require("express");
// Create the API application.
var api = express();
api.get("/v1/money", function(req, res) {
res.json({ "bling": "$$$" });
});
module.exports = api;
var express = require("express");
// Create the main application.
var app = express();
// Mount the API express app on `/api`.
app.use("/api", require("./api"));
// Send some strings.
app.get("/", function(req, res) {
res.send("Hello world!");
});
// Listen here.
app.listen(8080, "127.0.0.1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment