Created
February 21, 2014 23:30
-
-
Save tbranyen/9145866 to your computer and use it in GitHub Desktop.
This file contains 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
var express = require("express"); | |
// Create the API application. | |
var api = express(); | |
api.get("/v1/money", function(req, res) { | |
res.json({ "bling": "$$$" }); | |
}); | |
module.exports = api; |
This file contains 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
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