Skip to content

Releases: barelyhuman/conrou

v0.1.2-alpha.7

Choose a tag to compare

@barelyhuman barelyhuman released this 04 Jun 10:38

What's Changed

  • Feat: allow getting routes from actions by @barelyhuman in #1
  • Feat: register and use named middleware
  • Feat: allow using normal req,res handlers as functions

Full Changelog: v0.1.2-alpha.4...v0.1.2-alpha.7

v0.1.2-alpha.4

Choose a tag to compare

@barelyhuman barelyhuman released this 31 May 11:01

Changes

  • Added generation of url from controller bindings.
// file1.js
const router = createControllerBinder(mockRouter)

router.register(
    class NamedController {
      index(req) {
        return req.params.id
      }
    }
)

router.get('/get/:id', 'NamedController.index')

// file2.js 
 
const route = router.getRoute('NamedController.index', { id: 1 }) // => /get/1