Skip to content Skip to sidebar Skip to footer

Angularjs2 Spa - How To Change Gulp Task To Prevent Cannot Get /page Error

the problem: i get 'Cannot GET /heroes' or 'Cannot GET /dashboard' errors when trying to reach http://localhost:9000/dashboard or http://localhost:9000/heroes i currently have a g

Solution 1:

here is the answer how to set it up in that gulp task:

var historyApiFallback = require('connect-history-api-fallback');
var bs = require('browser-sync').create();
bs.init({
    server: {baseDir: "./", middleware: [ historyApiFallback() ]}
});

Post a Comment for "Angularjs2 Spa - How To Change Gulp Task To Prevent Cannot Get /page Error"