Serving the frontend through the backend server

Before we start building our frontend app, let's make sure we can browse to it.

To do so, change the "restangular" : "1.4.0" , line in src/backend/server.js:

var server = Percolator({'port': port, 'autoLink': false});

The changed line is as follows:

var server = Percolator({'port': port, 'autoLink': false, 'staticDir':\ __dirname + '/../frontend'});

With this change, Percolator will serve everything in src/frontend as static files (while still serving the API at the /api route).

Get The Node Craftsman Book now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.