-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML5 PushState #787
Comments
ok I try to look into it, btw tinkering with express with the same issue. |
Alright I manage to solve this by looking to pushstate-server by scottcorgan. /**
*
* Install:
* npm install browser-sync pushstate
*
* Run:
* node <yourfile.js>
*
* This example will create a middleware to serve files from within a given root directory
* with mod rewrite and compression, this will enable push state and history location callback
*
*/
"use strict";
var bs = require("browser-sync").create();
var express = require('express');
var modRewrite = require('connect-modrewrite');
var compression = require('compression');
var path = require('path');
var app = express();
//the root directory of serve static files
var publicPath = path.resolve(__dirname, 'public');
/**
* Register with express
*/
app.use(express.static(publicPath));
app.use(modRewrite([
'!\\.html|\\.js|\\.json|\\.ico|\\.csv|\\.css|\\.png|\\.svg|\\.eot|\\.ttf|\\.woff|\\.appcache|\\.jpg|\\.jpeg|\\.gif /index.html [L]'
]));
app.use(compression());
/**
* Start the Browsersync server and
* load the express app as middleware
*/
bs.init({
server: "./app",
middleware: [app]
}); If you ok with this, I send a pull request |
heh but console keep spewing socket.io pool errors.. |
Is there anyway to set up browser-sync server to send my app at every non-static-asset url?
or browsersync to support HTML5 PushState
The text was updated successfully, but these errors were encountered: