hoodie icon indicating copy to clipboard operation
hoodie copied to clipboard

Feature: Create docs to suggest users to use monitor and watcher tools.

Open Manosmer opened this issue 7 years ago • 7 comments

I have an idea to implement pm2 as a start/stop/monitor server service, with a watcher activated in order to achieve an auto-restart function of the server every time a change is made in somebody's project. In that way we can save our users from the frustrating process of closing and reopening the server every time they add something new.

Manosmer avatar Feb 25 '17 20:02 Manosmer

I don’t know about pm2. Would that be something that would be incorporated in Hoodie’s codebase or something we could add to the documentation as a tip for people working on Hoodie apps?

gr2m avatar Feb 26 '17 00:02 gr2m

pm2 is an independant module that can deamonize processes (make them run on the background) and it provides basic monitoring and file watching. For example if you want to run server.js (which is a file that implements a basic expressjs server) then, instead of node server.js, you can give the command pm2 start --name="My Server" --watch server.js -- [parameters that server.js file requires separated with '--']. What will follow is that pm2 will run server on the background with a process id and the name of "My Server". Also, it will watch the files of the project to locate changes and restart the server automatically. At last, with the command pm2 monit, a batch file is being executed and percetages of CPU and main memory usage are shown in the command line interface, for every process the pm2 has started.

Manosmer avatar Feb 26 '17 00:02 Manosmer

@gr2m @Litarhis

IMHO using pm2 would be somewhat an overkill because pm2 is used for running node apps in the production

In that way we can save our users from the frustrating process of closing and reopening the server every time they add something new.

If I'm not mistaken, the user here is the developer hence my concerns about using a production tool. What we could do here is go for nodemon or something similar.

mbad0la avatar Feb 26 '17 02:02 mbad0la

@Litarhis sounds like a super cool tool! I agree with @mbad0la that it might be a bit overkill, but it sounds interesting nevertheless? Maybe worth to write a blog post on it?

If it’s a tool used in production, maybe we could amend our deployment docs?

gr2m avatar Feb 26 '17 02:02 gr2m

If it’s a tool used in production, maybe we could amend our deployment docs?

Any docs related to deployment would benefit from this, so this is a good addition.

As for local setups, I guess we should probably leave it to the developer. A blog post would come in handy in such a scenario.

mbad0la avatar Feb 26 '17 03:02 mbad0la

@gr2m @mbad0la, I think you are both right. It's better to leave it to the preferences of the user (a.k.a. developer). It's better if we can create a doc about suggesting our users to use a watcher and how to do so.

Manosmer avatar Feb 26 '17 13:02 Manosmer