Backbone pushState is returning raw JSON data

I am attempting to implement pushstate for my Backbone/NodeJS application. If I go to the following route /testRoute/123 within the browser itself, from another view, the associated views to /testRoute/123 load.

However, if I manually enter /testRoute/123 in the address bar, the browser returns a raw JSON feed for the object with id '123'.

How do I force Backbone to load the views when manually entering a URL?

This is not something Backbone can do (hense why pushState is disabled by default). You have to setup your server to redirect those requests to the root so that your HTML loads and Backbone can handle the route.

This is stated in the Backbone documentation:

Note that using real URLs requires your web server to be able to correctly render those pages, so back-end changes are required as well. For example, if you have a route of /documents/100, your web server must be able to serve that page, if the browser visits that URL directly. For full search-engine crawlability, it's best to have the server generate the complete HTML for the page ... but if it's a web application, just rendering the same content you would have for the root URL, and filling in the rest with Backbone Views and JavaScript works fine.

In case @idbehold's answer wasn't specific enough, here's a more detailed response to the same question.

I highly recommend looking at those links at the bottom of the response as they were exactly what I was looking for when faced with the same bother...