Skip to content

Instantly share code, notes, and snippets.

@natmegs

natmegs/index.js

Created Aug 26, 2017
Embed
What would you like to do?
index routes for express router example
var express = require('express');
// Router middleware;
// put GETs/POSTs/etc on Router
var router = express.Router();
// GET /index/
router.get('/', function(req, res, next) {
res.send('Root');
});
// GET /index/something
router.get('/something', function(req, res, next) {
res.send('respond with something');
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.