h2non / rocky

Full-featured, middleware-oriented, programmatic HTTP and WebSocket proxy for node.js (deprecated)
MIT License
371 stars 24 forks source link

rocky installable via PM2 #28

Open Unitech opened 9 years ago

Unitech commented 9 years ago

Would be awesome to make rocky installable via PM2,

I recently embedded a npm install procedure + start with PM2 to make possible to install software easily by doing something like that:

$ pm2 install <npm-package-name>

There is a small documentation about the system

Tell me if you are interested to build a module like that, I can make modifications on the PM2 configuration system and related.

h2non commented 9 years ago

Thanks for the proposal.

Sounds good to me. After a brief reading of the PM2 docs, I believe that I best fit is creating another package specifically for PM2 ecosystem, e.g: pm2-rocky.

I would prefer keeping rocky repository agnostic of any specific non-mandatory tool, but I'm totally open to provide and simplify the ways that people can use it with a specific handy tool.

I'll analyze in detail the PM2 modules and how to build a proper module wrapper for rocky.

Unitech commented 9 years ago

Sure keep rocky as a module name it's perfect!

You can already install rocky like that:

$ pm2 install rocky

Now the problem is how to configure rocky easily, I will have a look on how to point rocky to a specified TOML file

h2non commented 9 years ago

Perfect.

Regarding to the TOML configuration, I'll consider supporting two additional ways to load the config:

This should mitigate the CLI overhead. Sounds good for the PM2 integration as well?

h2non commented 9 years ago

I'm taking a look to the PM2 docs in order to find a proper way to configure rocky without too much pain.

Since rocky will be mostly consumed from CLI from PM2, I think the proper way to do this is passing it via args config, or even via environment variable like ROCKY_CONFIG, pointing to the config file path.

Do you see another more convenient way to integrate rocky?