gulp.task('connect',function() { connect.server({ root: __dirname,livereload: true }); });
和以下Angular路线:
angular.module("MyApp",["ngRoute"]).config(function($routeProvider,$locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when("/",{ controller: "DashboardCtrl",templateUrl: "templates/dashboard.html" }) .when("/advertiser",{ controller: "AdvertiserCtrl",templateUrl: "templates/advertiser.html" }) .otherwise({ redirectTo: "/" }); });
当我访问/所有工作正常(仪表板出现)。
但是,访问/广告客户会导致“404 – 无法获取/广告客户”。
我的主要角色文件是index.html,它正确地打开/,但不是/广告商。
无论URL如何,我怎么能告诉Gulp打开index.html?