August 2016
Intermediate to advanced
376 pages
6h 33m
English
Now let's create the route file.
Inside the routes folder, create a new file called index.js and add the following code:
// Import Express and Router
var express = require('express');
var router = express.Router();
// Get
router.get('/', function(req, res) {
res.render('index', {
title: 'Socket.io chat application',
lead: 'Insert your user name and start talk'
});
});
module.exports = router;
As we are building a simple chat application, we will have just one route.
Read now
Unlock full access