Skip to content

Instantly share code, notes, and snippets.

Created Aug 26, 2017
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) {
// 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