Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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/` ...Squashed commit of the following: commit 42f9c53 Author: sc0ttj <[email protected]> Date: Sun Jul 26 12:50:58 2020 +0000 README fix commit ca99dc3 Author: sc0ttj <[email protected]> Date: Sun Jul 26 12:47:38 2020 +0000 README fix commit 7310b4d Author: sc0ttj <[email protected]> Date: Sun Jul 26 12:42:08 2020 +0000 small improvement to CLI router docs commit f9c7aad Author: sc0ttj <[email protected]> Date: Wed Jul 22 00:51:18 2020 +0000 updated lambda example commit e5152fa Author: sc0ttj <[email protected]> Date: Tue Jul 21 18:03:45 2020 +0000 clean up: remove logging, add comments commit bc94c3e Author: sc0ttj <[email protected]> Date: Tue Jul 21 17:16:44 2020 +0000 fix wildcard routes that end with a "*" commit 1e0f6c0 Author: sc0ttj <[email protected]> Date: Tue Jul 21 13:52:50 2020 +0000 fix running HTTP server commit 2cfae8f Author: sc0ttj <[email protected]> Date: Tue Jul 21 01:23:45 2020 +0000 lambda fix: handle base64 encoded event bodies commit c92931e Author: sc0ttj <[email protected]> Date: Tue Jul 21 00:04:10 2020 +0000 make lambdas mroe consistent with HTTP servers: event.body is replaced by parsed JS object version, if it was URL or JSON encoded - same as in Node servers commit 1d57f07 Author: sc0ttj <[email protected]> Date: Mon Jul 20 23:02:25 2020 +0000 README update commit 86c335c Author: sc0ttj <[email protected]> Date: Mon Jul 20 23:00:14 2020 +0000 small code clean up, small fixes to lambda middleware setup, updated docs commit 2eed064 Author: sc0ttj <[email protected]> Date: Mon Jul 20 22:41:54 2020 +0000 fix middleware setup: - do it before processing a route - do it for node servers and lambdas - run middleware in each lambda request too (not only node servers) commit 16fb6b9 Author: sc0ttj <[email protected]> Date: Mon Jul 20 22:22:12 2020 +0000 README fix commit ac05793 Author: sc0ttj <[email protected]> Date: Mon Jul 20 22:19:39 2020 +0000 README fix commit 0c49901 Author: sc0ttj <[email protected]> Date: Mon Jul 20 21:48:51 2020 +0000 updated README commit c68381e Author: sc0ttj <[email protected]> Date: Mon Jul 20 21:31:58 2020 +0000 better body handling for lambdas (based on "middy" src code) commit b390ba8 Author: sc0ttj <[email protected]> Date: Mon Jul 20 11:04:22 2020 +0000 dont throw caught middleware errors, just log them out commit 3d2a14a Author: sc0ttj <[email protected]> Date: Mon Jul 20 00:54:59 2020 +0000 updated README, lambda stuff commit 4edb5e7 Author: sc0ttj <[email protected]> Date: Mon Jul 20 00:45:29 2020 +0000 updated README, lambda stuff commit ef2d5d3 Author: sc0ttj <[email protected]> Date: Mon Jul 20 00:44:33 2020 +0000 updated README, lambda stuff commit c010cf5 Author: sc0ttj <[email protected]> Date: Mon Jul 20 00:43:16 2020 +0000 updated README, lambda stuff commit a116309 Author: sc0ttj <[email protected]> Date: Mon Jul 20 00:42:33 2020 +0000 updated README, lambda stuff commit 3a2d090 Author: sc0ttj <[email protected]> Date: Mon Jul 20 00:30:44 2020 +0000 README fix commit 4c21c4a Author: sc0ttj <[email protected]> Date: Mon Jul 20 00:20:20 2020 +0000 new: run middleware only for specific routes: router.use("/some-path", myMiddleware) router.use("/some-path", [fn1, fn2]) commit 7e8f88d Author: sc0ttj <[email protected]> Date: Sun Jul 19 23:02:10 2020 +0000 test on all recent Node versions commit de1f6a3 Author: sc0ttj <[email protected]> Date: Sun Jul 19 22:54:51 2020 +0000 more express-compatible handling of errors thrown by middleware (maybe) commit ef6e6bc Author: sc0ttj <[email protected]> Date: Sun Jul 19 21:55:13 2020 +0000 safer body parsing: try to detect if `body-parser` already ran commit 6967904 Author: sc0ttj <[email protected]> Date: Sun Jul 19 20:44:49 2020 +0000 safer res.jsonp() - stolen from expressjs commit 596d1fe Author: sc0ttj <[email protected]> Date: Sun Jul 19 20:21:42 2020 +0000 README update commit 84b3fde Author: sc0ttj <[email protected]> Date: Sun Jul 19 20:13:51 2020 +0000 README updates commit e31291d Author: sc0ttj <[email protected]> Date: Sun Jul 19 19:38:00 2020 +0000 added Lambda example to README commit 7a59bfa Author: sc0ttj <[email protected]> Date: Sun Jul 19 19:07:45 2020 +0000 README updates commit 5c352bb Author: sc0ttj <[email protected]> Date: Sun Jul 19 18:59:26 2020 +0000 updated package.json commit 34511b7 Author: sc0ttj <[email protected]> Date: Sun Jul 19 18:56:32 2020 +0000 new: support lambdas and basic HTTP body parsing: - added check for lamda, and basic parsing and routing of event obj - improved HTTP server support: - fixed some expressjs API compatibility - improved handling of middleware, support for using next() - parse HTTP body into params object, if URL or JSON encoded - updates to README and examples/
- Loading branch information