Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created February 10, 2013 09:36
Show Gist options
  • Save geNAZt/4748979 to your computer and use it in GitHub Desktop.
Save geNAZt/4748979 to your computer and use it in GitHub Desktop.
//app.js
var express = require('express'),
app = express(),
routes = require('./routes')(app);
//routes.js
module.exports = function (app) {
app.get("/", require("./models/index"));
app.get("/foo", require("./models/foo"));
app.get("/bar", require("./models/bar"));
}
//models/index.js
module.exports = function(req, res) {
res.end("Index");
};
//models/foo.js
module.exports = function(req, res) {
res.end("Foo");
};
//models/bar.js
module.exports = function(req, res) {
res.end("Bar");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment