【发布时间】:2014-09-26 13:51:01
【问题描述】:
在我的gulpfile.js 中,我将express 设置为始终返回index.html。
var server = express();
server.use(livereload({ port: 35729 }));
server.use(express.static('./app'));
server.all('*', function(req, res) {
res.sendFile('index.html', { root: './app' });
});
server.listen(8000);
refresh.listen(35729);
我第一次导航到localhost:8000 时一切正常。我的 Angular 路由重定向到 http://localhost:8000/home。
但是,如果我刷新http://localhost:8000/home,我会在控制台中看到以下错误:
Uncaught SyntaxError: Unexpected token <
为什么会这样?
【问题讨论】:
标签: angularjs gulp gulp-livereload