Coder Social home page Coder Social logo

koa-66's People

Contributors

alexanderneu avatar buunguyen avatar fredericheem avatar menems avatar monder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

koa-66's Issues

params leaking from route to route

If routes like this are used

router.get('/appointments/validate', appointments.validate)
router.get('/appointments/:id', appointments.fetch)

the appointments.validate middleware gets an 'id' param with the value 'validate'.

Can not get the resolve result from route

Here is my code

app.use((ctx, next) => {
  console.info('1')
  next().then(result => {
    console.log('3')
    console.log(result) // expect hello
  })
})

app.use(apiRouter.routes())
const router = new Router()
const apiRouter = new Router()

router.get('/apps', (ctx) => {
  console.log('2')
  return Promise.resolve('hello')
})

apiRouter.mount('/api', router)
module.exports = apiRouter

but terminal shows

1
2
3
undefined

Error with plugin

If you use 2 routes using the same plugin such as :

.delete('/:id', { acl: ['HELPDESK'] }, (ctx) => {}

and

.put('/user/validate', { acl: ['DIRECTION'] }, (ctx) => {}

Your second route will take { acl: ['HELPDESK'] } instead of { acl: ['DIRECTION'] } as plugin.

Put methods on prototype

Instead of setting methods in the contructor put them in the prototype where all the other methods are.

1.0.0 release

task list

  • comments
  • more Test (async missing)
  • Docs
  • Consolidate input test
  • Add multiple middleware support
  • 405 Method Not Allowed and 501 Not Implemented.

v1.0.0

I'm pubilshing a v1.0.0 version , now that koa has 2.0.0 tag on github/npm
There is no change since the last version, and i think this project is enought stable to have a v1.

So don't panic if you see a v1 version this is a same version than v0.8.5. it 's just a semantic update and some devdependencies update

thanks

Support `all` methods?

Hi, it would be great if koa-66 support route.all(...) like koa-router. Currently I hack around my code by defining a route for every method in response to all, but that's terribly inefficient.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.