diff --git a/server.js b/server.js index 57f7ea0..1dc6520 100644 --- a/server.js +++ b/server.js @@ -141,9 +141,13 @@ app.use(connect_st({ // Then we can loop back - and everything else should be a token, // so route it back to / app.use(route(function(router) { - router.get('/:id', function(request, _response, next) { - request.sturl = '/'; - next(); + router.get('/:id', function(request, response, next) { + if (request.headers.accept.includes('html')) { + request.sturl = '/'; + next(); + } else { + return raw(request, response); + } }); }));