October 2016
Intermediate to advanced
452 pages
9h 5m
English
Let's do a little more work setting up our SPA by building out some resourceful routing as part of a RESTFul API that we can connect later to our database and our client-side code. We're lucky that Express has such a vibrant community of developers building many add-ons, and we're going to use one for resourceful routing.
The first thing we need to do is to install our module, which will provide us with some resourceful routing:
npm install resource-routing -save
This installs the resourceful routing plugin we're going to use, and saves a reference to the package.json file.
Next, we need to do some setup in our app.js file:
var express = require('express'); var path = require('path'); var favicon ...Read now
Unlock full access