私は常に返すようgulpfile.jsに設定しました。expressindex.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 <
なぜこうなった?