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 koa = require('../..');
|
||||
|
||||
exports = module.exports = function(req, res){
|
||||
module.exports = function(req, res){
|
||||
const socket = new Stream.Duplex();
|
||||
req = req || { headers: {}, socket: socket, __proto__: Stream.Readable.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);
|
||||
}
|
||||
|
||||
exports.request = function(req, res){
|
||||
return exports(req, res).request;
|
||||
module.exports.request = function(req, res){
|
||||
return module.exports(req, res).request;
|
||||
}
|
||||
|
||||
exports.response = function(req, res){
|
||||
return exports(req, res).response;
|
||||
module.exports.response = function(req, res){
|
||||
return module.exports(req, res).response;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue