How to create a self-updating Node.js application?

后端 未结 4 1309
孤独总比滥情好
孤独总比滥情好 2021-02-13 13:29

I\'d like to create an application with Node.js that periodically checks for updates and installs them if there are any.

The basic components are clear to me:

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-13 14:00

    First, you could use NPM itself for package and app delivery. Second, you could add a script file to add a cron job in the package.json file (e.g. 'postinstall' or 'update') for a periodic update process. In this script you could check all you need like broken updates. In Heroku you can use a Scheduler Worker for update processing.

提交回复
热议问题