Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lasso/middleware & koa v2 #161

Open
basickarl opened this issue Aug 29, 2016 · 2 comments
Open

lasso/middleware & koa v2 #161

basickarl opened this issue Aug 29, 2016 · 2 comments

Comments

@basickarl
Copy link
Contributor

basickarl commented Aug 29, 2016

https://github.com/koajs/koa

I peeked in the middleware.js file and see that it's been made to comply with express. I tweaked my own version and is working. Just want you to know this!

working for koa (lasso/middleware/serveStatic.js):

    // line 44
    return function(ctx, next) {
        var req = ctx.request,
            res = ctx.response;

In koa ctx is passed instead of express' req and res.

@basickarl
Copy link
Contributor Author

Currently:

module.js:471
    throw err;
    ^

Error: Cannot find module 'lasso/middleware/koa'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/karl/dev/node/sketch/experiment/koa-babel-lasso/src/index.js:7:1)
    at Module._compile (module.js:570:32)
    at loader (/home/karl/dev/node/sketch/experiment/koa-babel-lasso/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/karl/dev/node/sketch/experiment/koa-babel-lasso/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

I've fully fixed this now, tested on both koa and koa@2. Here is the pull request.

#169

@basickarl
Copy link
Contributor Author

Currently fixing the send module so that it works with both versions of koa, once that is fixed I'll update lasso.
pillarjs/send#120 (review)
pillarjs/send#118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant