Last active
October 6, 2016 03:22
-
-
Save jesusmacedo/4c1c99c119b4d662393b742a6f0bd012 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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