m2node

当前版本: 0.2.0


m2node是什么?

mongrel2处理程序
mongrel2 handler

许可协议

MIT

关键词

http , mongrel2

安装方式

npm install m2node@0.2.0

相关网址


m2node使用说明

m2node

m2node is a mongrel2 handler for node

install (安装)

npm install m2node

example (示例)

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');
});

m2node.run(server, {
  send_spec: 'tcp://127.0.0.1:9996',
  recv_spec: 'tcp://127.0.0.1:9997'
});

configuration (配置)

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')
});

m2node.run(
  http.createServer(app), {
    send_spec: 'tcp://127.0.0.1:9996'
    recv_spec: 'tcp://127.0.0.1:9997'
});

contributors (贡献者)

see package.json

项目热度

项目信息

分享到

基本信息
开发语言
JavaScript
相关项目
0
相关仓库
8
Watchers
4
Stars
53
Forks
12
版本数量
5
最新发布
2012-01-19
首次发布
2011-06-04
仓库大小
134 KB

版本历史
0.2.0
2012-01-19
0.1.3
2012-01-19
0.1.2
2011-07-03
0.1.1
2011-06-09
0.1.0
2011-06-04

贡献者
Dan Manges