August 2016
Intermediate to advanced
376 pages
6h 33m
English
We will edit the app.js file to add routes to the band-list.html view and also their respective controller:
app.js and add the following lines after the index controller import: // Inject band controller
var bands = require('./controllers/band');
// Inject user controller
var users = require('./controllers/user');
app.get('/', index.show);: // Defining route to list and post app.get('/bands', bands.list); // Get band by ID app.get('/band/:id', bands.byId); // Create band app.post('/bands', bands.create); // Update app.put('/band/:id', bands.update); // Delete by id app.delete('/band/:id', bands.delete); // Defining route to list and post users app.get('/users', ...Read now
Unlock full access