Crescent framework middleware adapter for vicoproplus/moon_ua_parser: mounts parsed UaInfo on the request/response context and emits degradation forensics
moon add bobzhang/crescent
moon add vicoproplus/moon_ua_parser
moon add vicoproplus/moon_ua_parser_middleware_core
moon add vicoproplus/moon_ua_parser_crescentPre-release note: vicoproplus/moon_ua_parser_crescent is not yet published to the mooncakes registry — moon add applies after the first release; until then, users inside this repository's moon.work workspace already consume the package as a local path dependency.
// build + register on a crescent App (onion model, async callbacks)
let app = @crescent.App()
app.use_middleware(@middleware.request_id()) // optional: request correlation
app.use_middleware(@moon_ua_parser_crescent.middleware()) // UA parsing + mount + forensics
app.get("/probe", event => {
// handler-side typed read-back of the mounted value
match @moon_ua_parser_crescent.mounted_ua_info(event) {
Some(info) => "browser=\{info.browser.family}"
None => "nothing-mounted"
}
})moon run moon_ua_parser_crescent/examples/ua_echo --target nativemoon test --target native -p moon_ua_parser_crescentlet FORENSICS_LOG_PREFIX : Stringlet HEADER_UA_BROWSER : Stringlet HEADER_UA_DEVICE : Stringlet HEADER_UA_INFO : StringInstall
Download zipCrescent framework middleware adapter for vicoproplus/moon_ua_parser: mounts parsed UaInfo on the request/response context and emits degradation forensics