no more exports! only module.exports
This commit is contained in:
parent
e8f79d43f9
commit
46f8d49e4c
1 changed files with 5 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
||||||
const Stream = require('stream');
|
const Stream = require('stream');
|
||||||
const koa = require('../..');
|
const koa = require('../..');
|
||||||
|
|
||||||
exports = module.exports = function(req, res){
|
module.exports = function(req, res){
|
||||||
const socket = new Stream.Duplex();
|
const socket = new Stream.Duplex();
|
||||||
req = req || { headers: {}, socket: socket, __proto__: Stream.Readable.prototype };
|
req = req || { headers: {}, socket: socket, __proto__: Stream.Readable.prototype };
|
||||||
res = res || { _headers: {}, socket: socket, __proto__: Stream.Writable.prototype };
|
res = res || { _headers: {}, socket: socket, __proto__: Stream.Writable.prototype };
|
||||||
|
@ -14,10 +14,10 @@ exports = module.exports = function(req, res){
|
||||||
return koa().createContext(req, res);
|
return koa().createContext(req, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.request = function(req, res){
|
module.exports.request = function(req, res){
|
||||||
return exports(req, res).request;
|
return module.exports(req, res).request;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.response = function(req, res){
|
module.exports.response = function(req, res){
|
||||||
return exports(req, res).response;
|
return module.exports(req, res).response;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue