mars framework middleware adapter for vicoproplus/moon_ua_parser: mounts parsed UA families on the typed request context and emits degradation forensics
moon add mizchi/mars
moon add vicoproplus/moon_ua_parser
moon add vicoproplus/moon_ua_parser_middleware_core
moon add vicoproplus/moon_ua_parser_marsPre-release note: vicoproplus/moon_ua_parser_mars 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 mars Server (Hono-style sequential chain)
let app = @mars.Server::new()
app.middleware(@middleware.logger_simple()) // optional: mars's own log channel
app.middleware(@moon_ua_parser_mars.middleware()) // UA parsing + mount + forensics
app.get("/probe", ctx => {
// handler-side typed read-back of the mounted value
match @moon_ua_parser_mars.mounted_ua_info(ctx) {
Some(info) => "browser=\{info.browser.family}"
None => "nothing-mounted"
}
})moon run moon_ua_parser_mars/examples/ua_echo --target nativemoon test --target native -p moon_ua_parser_marslet FORENSICS_LOG_PREFIX : Stringlet KEY_UA_BROWSER : Stringlet KEY_UA_DEVICE : StringInstall
Download zipmars framework middleware adapter for vicoproplus/moon_ua_parser: mounts parsed UA families on the typed request context and emits degradation forensics