Skip to content

Releases: sc0ttj/router

v2.0.1 Released

02 Nov 18:51
Compare
Choose a tag to compare

Updated to 2.0.1:

  • Tested and working in Node v10+, and on various modern browsers:
  • Fixes for getting URL path
  • Fixes for getting query string into params object
  • Fixes if no hash path in URL
  • Fixes for running HTTP server and Lambda middleware
  • Use export default, point all examples to the dist build
  • clean up in src/router.js
  • small updates to examples/

v2.0.0 Released

26 Jul 12:05
Compare
Choose a tag to compare
  • New: support AWS lambda
  • added check for lamda env, and basic parsing and routing of the lambda event object
  • added middleware support: middleware funcs take (event, next), not (req, res, next)
  • everything else is the same as HTTP middleware
  • Fix: improved HTTP server support
    • fixed some expressjs API compatibility issues (available methods, order of params, etc)
    • improved handling of middleware:
      • can use next(), with error handling
      • can use middleware only for specific routes:
        • router.use('/admin', loadAdminUI) - add one middleware func to run if user requested /admin
        • router.use('/admin', [auth, loadAdminUI]) - or add a list of middleware to the specific route
    • parse HTTP body into one string, and then into params object if URL or JSON encoded
  • Fix: process * in routes patterns better
  • Fix: process CLI arguments better (no "routes" needed as first param)
  • Updates to README.md and examples/

v1.0.0 Released

28 Mar 17:41
Compare
Choose a tag to compare

Initial release