forked from hushicai/node-phpcgi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (30 loc) · 822 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* @file entry
* @author hushicai(bluthcy@gmail.com)
*/
/* eslint-env node */
var phpcgi = require('./src/main');
// middleware
function fn(options) {
var documentRoot = options.documentRoot;
var handler = options.handler;
var phpcgiArguments = options.args;
var extensions = options.extensions;
var includePath = options.includePath;
var entryPoint = options.entryPoint;
// middleware
return function(req, res, next) {
return phpcgi({
documentRoot: documentRoot,
handler: handler,
args: phpcgiArguments,
req: req,
res: res,
next: next,
extensions: extensions,
includePath: includePath,
entryPoint: entryPoint
});
};
}
exports = module.exports = fn;