If you open routes/index.js, you'll see the following few lines of code that were generated for us:
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
module.exports = router;
There isn't a whole lot surprising here: as we're starting to gather, Express files begin with require statements, especially for express itself. In the next code block, we're starting to see the beginnings of our REST service: GET home page. Look at the router.get() method right after the comment. It's explicitly stating to the router that when a GET request is received for the URL of /, execute this code.
We can verify this fact by adding a few more GET paths here, just for fun. Let's try modifying our code like so. After the router.get() block, but before module.exports, let's register more routes on...