I'm building a basic React/Flux application and using react-router-component for the routing, browser-sync for live reload on build changes, and browserify for dependency injection.
The problem that I have is that when the live reload or any reload occurs on a path that isn't /
(i.e. /profile
, /gallery
, etc...), I get an error message of Cannot GET /path
(or any route for that matter).
I suspect that this has something to do with the fact that it's a single page application and all routing is done on the client.
Here is my browser-sync setup (it's very basic). I think that I might need to add some middleware, but I'm not sure what to actually put in the middleware.
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: './client'
},
notify: false
});
});