Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[docs] Update docs to indicate that the pid is now returned.

  • Loading branch information...
commit 744a7c7d52240c2108d08ed0b9c2e16123a7ce9a 1 parent 4201dba
@AvianFlu authored
Showing with 7 additions and 3 deletions.
  1. +7 −3
@@ -58,13 +58,15 @@ application logic starts.
var http = require('http'),
prefork = require('prefork');
+var pid = prefork();
http.createServer(function (req, res) {
- res.end('I am a backgrounded HTTP server.');
+ res.end('I am a backgrounded HTTP server, running as ' + pid);
+`prefork()` will perform all necessary actions to background your process, and
+return the new `pid`.
### stdio redirection
@@ -74,10 +76,12 @@ To simply log all output to a file:
+var pid = prefork({
stdout: 'output.log'
+console.log('Started successfully, new pid is %d', pid);
If only `stdout` is provided, `stderr` will be redirected to the same place.
Please sign in to comment.
Something went wrong with that request. Please try again.