Skip to content

Instantly share code, notes, and snippets.

@tylerthebuildor
Created March 15, 2015 01:35
Show Gist options
  • Save tylerthebuildor/5bf40927a3af789f8843 to your computer and use it in GitHub Desktop.
Save tylerthebuildor/5bf40927a3af789f8843 to your computer and use it in GitHub Desktop.
generator-angular-gulp html5mode modrewrite
$ npm install --save-dev connect-modrewrite
Then edit gulp/server.js
var modRewrite = require('connect-modrewrite');
function browserSyncInit(baseDir, files, browser) {
browser = browser === undefined ? 'default' : browser;
browserSync.instance = browserSync.init(files, {
startPath: '/index.html',
server: {
baseDir: baseDir,
middleware: [
proxyMiddleware,
modRewrite([
'!\\.\\w+$ /index.html [L]'
])
]
},
browser: browser
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment