Syntax Error in Angular App: Unexpected token <

后端 未结 30 2154
独厮守ぢ
独厮守ぢ 2020-12-02 20:16

I have an Angular app which runs perfectly in my local and production environment.. After a tiny change I made, I ran the app locally and it works fine.. Then I built the pr

30条回答
  •  猫巷女王i
    2020-12-02 20:30

    It depends on the server, you are using. For example with Apache, you set the .htaccess file to a relative path on your drive, where your app is located with RewriteBase. Also set the accordingly.

    With node, the

    app.use(express.static(__dirname + '/dist'));
    

    should go before app.get.

    Check also, that the build had no errors and all files were copied to dist.

提交回复
热议问题