Releases: sc0ttj/router
Releases · sc0ttj/router
v2.0.1 Released
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
- 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
- can use
- 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
andexamples/
v1.0.0 Released
Initial release