Deploy Angular 5 + Nodejs Express app to Heroku

前端 未结 8 1429
清酒与你
清酒与你 2021-02-04 02:35

I have an Angular 5 App.

This is what I have in my package.json

{
  "name": "web",
  "version": "0.0.0&         


        
8条回答
  •  庸人自扰
    2021-02-04 03:12

    In your server.js you need to redirect your http call to the index.

    app.route('/*', function(req,res) {
      res.redirect(__dirname + '/dist/index.html')
    })
    

    In the above it'll redirect any call to your index.html.

提交回复
热议问题