mongrel2 handler for node.js
Switch branches/tags
Nothing to show
Clone or download


m2node is a mongrel2 handler for node


npm install m2node


var http = require('http'),
    m2node = require('m2node');

var server = http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
});, {
  send_spec: 'tcp://',
  recv_spec: 'tcp://'


The configuration is from the perspective of the handler, so the send_spec in your mongrel2 config should match the recv_spec in your node config.

example - express

here's an example of serving an app built using the express framework with m2node

var express = require('express'),
    http = require('http'),
    m2node = require('m2node');

var app = express();

app.get('/', function (req, res) {
  res.send('Hello World')
  http.createServer(app), {
    send_spec: 'tcp://'
    recv_spec: 'tcp://'


see package.json