Skip to content

Instantly share code, notes, and snippets.

@jesusmacedo
Last active October 6, 2016 03:22
Show Gist options
  • Save jesusmacedo/4c1c99c119b4d662393b742a6f0bd012 to your computer and use it in GitHub Desktop.
Save jesusmacedo/4c1c99c119b4d662393b742a6f0bd012 to your computer and use it in GitHub Desktop.
// index.html <base href="/"> always after <title></title>
<title></title>
<base href="/">
// app.js
.config(['$locationProvider',
function ($locationProvider) {
// ...
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
// ...
}]);
// install with npm
npm install connect-modrewrite --save
// Gruntfile.js add at the top of the file
var modRewrite = require('connect-modrewrite');
// inside the connect section overwrite livereload with this
livereload: {
options: {
open: true,
middleware: function (connect) {
return [
modRewrite(['^[^\\.]*$ /index.html [L]']),
connect.static('.tmp'),
connect().use(
'/bower_components',
connect.static('./bower_components')
),
connect.static(appConfig.app)
];
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment