Adding a route for retrieving categories

We currently only provide keywords data through our backend API. The app requests keywords data as well as categories data, and the latter would fail for now. Let's implement the required route and logic now.

We first need to extend the spec in spec/e2e/apiSpec.js:

 'use strict'; var request = require('request'); var dbSession = require('../../src/backend/dbSession.js'); var Server = require('../../src/backend/server.js').Server; var resetDatabase = require('../resetDatabase.js'); var async = require('async'); describe('The API', function () { var server; beforeEach(function (done) { server = Server('8081'); server.listen(function (err) { resetDatabase(dbSession, function() { done(err); }); }); }); ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.