Skip to content

Instantly share code, notes, and snippets.

@jeonghwan-kim
Created March 13, 2014 04:55
Show Gist options
  • Select an option

  • Save jeonghwan-kim/9522068 to your computer and use it in GitHub Desktop.

Select an option

Save jeonghwan-kim/9522068 to your computer and use it in GitHub Desktop.
http server only using http module.
var http = require('http');
// Create an HTTP server
var srv = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('okay');
throw 'Error';
});
srv.listen(9999, '127.0.0.1', function() {
console.log("server is running");
});
@jeonghwan-kim
Copy link
Copy Markdown
Author

forever가 죽은 프로세스를 자동 재실행하는지 시험하기 위한 코드다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment