node http-server to respond with index.html to any request

后端 未结 6 1596
迷失自我
迷失自我 2020-12-09 10:31

I have installed http-server globally.

I launch it from myDir on localhost port 8080. In myDir I have index.html

6条回答
  •  情歌与酒
    2020-12-09 11:05

    A bit after the war, but anyway. for angular app, I suggest to add to your package.json:

    "serve-prod": "cp dist/app-name/index.html dist/app-name/404.html && http-server dist/app-name"
    

    Then call

    npm run serve-prod
    

提交回复
热议问题