Feature: Master Page

As a vision user
I want the vision application served as a single page
So that I can spend less time waiting for page loads

Let's add a test to ./test/home.js for our feature Master Page. This resource will GET our master page from route ./ and return a 200 OK response. The Content-Type of the response should be HTML:

   var app = require('../app')
 , request = require('supertest');

describe('vision master page', function(){
  describe('when requesting resource /', function(){
    it('should respond with view', function(done){
      request(app)
        .get('/')
        .expect('Content-Type', /html/)
        .expect(200, done)
    });
  });
});

Let's implement our Master Page feature. Let's create a new module that exposes a route ./lib/routes/home.js and add a new ...

Get Advanced Express Web Application Development 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.