Created
January 27, 2011 09:33
-
-
Save pgte/798291 to your computer and use it in GitHub Desktop.
app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: Fugue *almost* works great. But it doesn't seem to responsd to the USR2 signal correctly | |
// Try it one more time. | |
var fugue = require('fugue') | |
var path = require("path") | |
var sys = require('sys') | |
// https://github.com/pgte/fugue | |
// Send kill -USR2 <PID> to hot reload! 0 downtime. | |
// This catches it, but doesn't prevent it | |
// process.on('SIGHUP', function() { | |
// console.log("Caught SIGHUP") | |
// }) | |
// Run in production if you're using this | |
// process.env["NODE_ENV"] = "production" | |
var Port = 6001 | |
var Host = "0.0.0.0" | |
var Workers = 1 | |
var options = {} | |
options.started = function() {} | |
options.verbose = true | |
options.working_path = path.join(__dirname, "..") | |
// options.tmp_path = "" | |
options.log_file = "/tmp/apiweb.log" | |
// options.master_log_file = "" // defaults to normal log file | |
// options.uid = 501 | |
// options.gid = 20 | |
options.master_pid_path = "/tmp/apiweb.pid" | |
// options.worker_to_master_ping_interval = 30000 - ms - Default 30s | |
options.worker_kill_timeout = 10000 // - ms until you kill workers when master dies. Default 30s | |
fugue.start(require("./test"), Port, Host, Workers, options) | |
sys.puts("STARTED in production on " + Port + " with " + Workers + " workers") | |
// fugue.stop() | |
// fugue.isWorker() | |
// fugue.isMaster() | |
// fugue.workerPids() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
app = express.createServer(); | |
app.get('/', function(req, res) { | |
res.send('Hello World!'); | |
}); | |
module.exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment