How to run angular 2 app in background

末鹿安然 提交于 2019-12-11 05:11:11

问题


i have already tried following solution but it is not working.

sudo forever start -c "npm start" ./

and package.json file is something like this, look at the start command: (this is not full package.json)

"name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "lite": "lite-server",
    "gulp": "gulp",
    "start": "concurrent \"npm run gulp\" \"npm run lite\" ",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },

回答1:


I'm going to piggyback off of this question, most importantly this part:

nearly every Linux distro comes with systemd, which means forever, monit, etc are no longer necessary - your OS already handles these tasks.

You can configure a service file for angular2-quickstart that your OS's systemd can use to start up a background process for your application. Here is an article on deploying applications in Linux environments that can help.




回答2:


i have found angular-cli, which helps me to deploy my angular 2 app.



来源:https://stackoverflow.com/questions/37362765/how-to-run-angular-2-app-in-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!