Skip to content

Commit

Permalink
Make home route SPA compatible - ref #13
Browse files Browse the repository at this point in the history
  • Loading branch information
macintoshhelper committed May 2, 2017
1 parent 2abf02d commit 50d1f99
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/routes/home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const url = require('url');

const handler = (request, reply) => {
reply.view('index');
const parsedUrl = url.parse(request.url);
if (parsedUrl.query.ajax) reply.view('index', {}, { layout: 'spa' });
else reply.view('index');
};

module.exports = {
Expand Down

0 comments on commit 50d1f99

Please sign in to comment.