boxlang-express 0.2.31
Released .
- Lifecycle events (
models/LifecycleEvents.bx, docs/lifecycle-events.md). BoxLang's ownonRequestStart/onRequestEnd/onErrorinterception points never fire for a BoxExpress request, so the framework now announces its own:onExpressRequestStart({ req, method, path, startedAt }, before any middleware),onExpressError({ exception, method, path, route, responseSent }, once per request, the first time an error is thrown or passed tonext( err )) andonExpressRequestEnd({ method, path, route, status, durationMs }, once per request after the response is sent). Listen withboxRegisterInterceptor().routeis the matched pattern with the method (GET /feeds/:id), or<unmatched>. A listener that throws is logged and cannot change the response. A point with no listener is skipped before its data is built, so an app that doesn't listen behaves as before. req.routePattern(models/Router.bx) is the pattern of the matched route as registered (/feeds/:id), with the mount path in front inside a mounted router. Unset until a route matches, and emptied if that route callsnext().- An error no error handler answers is logged (
models/Router.bx). The default500was sent without printing anything, although the docs said the real message went to stdout. It now printsUnhandled error, GET /path: message, with the request id whenrequestIdis on. The response is unchanged. - A
?inside the path is kept in the access log (models/HttpBridge.bx). A request for/files/what%3Fnow.txtwas logged as/files/what, because the path was cut at the first?after decoding. The lifecycle events report the full path too. ModuleConfig.bxreported version 0.2.29 in the 0.2.30 release; it is back in step withbox.json.