dustinspecker / generator-ng-poly

Yeoman generator for modular AngularJS apps with Gulp and optional Polymer support
MIT License
237 stars 50 forks source link

Add Support for $locationProvider.html5Mode(true); #317

Open msenosiain opened 8 years ago

msenosiain commented 8 years ago

For using this feature I needed to add a middleware to browsersync initialization mannually. it would be nice to have it as an option when a module is created

dustinspecker commented 8 years ago

That sounds good to me. If anyone has time for a PR that would be much appreciated.

tomholford commented 8 years ago

In case anyone else is looking for how to config browsersync for HTML5 mode, add the middleware by installing this:

npm install connect-history-api-fallback --save-dev

And update gulp/watch.js:

  ...
  gulp.task('browserSync', function() {
    $.browserSync({
      host: config.host,
      open: 'external',
      port: config.port,
      server: {
        verbose: true,
        baseDir: config.buildDir,
        middleware: $.connectHistoryApiFallback()
      }
    });
  });
  ...