Skip to content

Browsersync for SPA

Shane Osbourne edited this page Sep 28, 2015 · 2 revisions

In order to support Single Page Applications Browsersync can be used with connect-history-api-fallback module as middleware.

See example below:

historyApiFallback = require('connect-history-api-fallback')

server: {
  baseDir: "...",
  middleware: [ historyApiFallback() ]
}

With this configuration every URL will point to the home page of the application.

Based on https://github.com/BrowserSync/browser-sync/issues/204