0.1.0 • Published 12 years ago

foreverize v0.1.0

Weekly downloads
2
License
-
Repository
github
Last release
12 years ago

Foreverize: in Soviet Russia, your server keeps itself up

Foreverize is a handy tool that makes it really easy to your server code to incorporate forever-monitor automatically.

This version is going up on github/npm by popular demand, but is in no way ready for the general public yet...

TODO list: 1. remove config/forever.json dependency (possibly put config into package.json) 1. remove hard-coded log paths 1. allow full config options that forever.Monitor supports 1. remove all the logging to stdout 1. cleanup code

Wish list: 1. zero-downtime restarts

Install

$ npm install foreverize

Quick Start

Install required dependencies (or through package.json)

$ npm install forever
$ npm install foreverize

In your server.js

var start_server = function(){
  require("http").createServer().listen(1337);
}

var foreverize = require("foreverize");
foreverize();
if(!foreverize.isMaster){
  start_server();
}

Now if your HTTP server crashes, it'll respawn itself. You can also use the normal forever commands to manage the process.

$ node_modules/.bin/forever list
info:    Forever processes running
data:        uid                command                        script                                          forever pid   logfile                                               uptime     
data:    [0] foreverize_example /usr/local/nvm/v0.8.8/bin/node /home/ilya/work/cm/foreverize_example/server.js 26326   26329 /home/ilya/work/cm/foreverize_example/log/forever.log 0:0:0:5.61    

Contributing

I welcome pull requests!

License

This software is distributed under the MIT License.

0.1.0

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago