Created
August 23, 2012 16:29
-
-
Save neara/3438304 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// in app.js | |
// Routes | |
var routes = require('./routes')(app); | |
app.get('/:controller/:action/:id', routes.get); | |
app.get('/:controller/:id', routes.get); | |
app.get('/:controller', routes.get); | |
app.get('/api/v2/*', routes.api); | |
app.get('/dev-status/:path', routes.dev_status); // this is what i want to add | |
app.get('/', routes.index); | |
//in /routes/dev_status.js | |
exports.dev_status = function(req, res){ | |
var path = req.params.path; | |
var ready = require('./ready.json'); | |
if (ready[path]){ | |
res.json({'status': 'ready'}); | |
} else { | |
res.json({'status': 'under development'}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment