[{"data":1,"prerenderedAt":1152},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fcore-concepts\u002Fapp-lifecycle":176,"\u002Fdocs\u002Fcore-concepts\u002Fapp-lifecycle-surround":1147},[4,21,86,158],{"title":5,"path":6,"stem":7,"children":8,"status":11,"icon":20},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,12,16],{"title":10,"path":6,"stem":7,"status":11},"Introduction",null,{"title":13,"path":14,"stem":15,"status":11},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","1.docs\u002F1.getting-started\u002F2.installation",{"title":17,"path":18,"stem":19,"status":11},"Quick Start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","1.docs\u002F1.getting-started\u002F3.quick-start",false,{"title":22,"path":23,"stem":24,"children":25,"status":11,"icon":20},"Core Concepts","\u002Fdocs\u002Fcore-concepts","1.docs\u002F2.core-concepts\u002F1.index",[26,28,32,36,46,50,54,58,62,66,70,74,78,82],{"title":27,"path":23,"stem":24,"status":11},"Overview",{"title":29,"path":30,"stem":31,"status":11},"Response","\u002Fdocs\u002Fcore-concepts\u002Fresponse","1.docs\u002F2.core-concepts\u002F10.response",{"title":33,"path":34,"stem":35,"status":11},"Testing","\u002Fdocs\u002Fcore-concepts\u002Ftesting","1.docs\u002F2.core-concepts\u002F12.testing",{"title":37,"path":38,"stem":39,"children":40,"status":11,"icon":20,"defaultOpen":20},"Decorators","\u002Fdocs\u002Fcore-concepts\u002Fdecorators","1.docs\u002F2.core-concepts\u002F13.decorators\u002F1.index",[41,42],{"title":27,"path":38,"stem":39,"status":11},{"title":43,"path":44,"stem":45,"status":11},"Custom","\u002Fdocs\u002Fcore-concepts\u002Fdecorators\u002Fcustom","1.docs\u002F2.core-concepts\u002F13.decorators\u002F2.custom",{"title":47,"path":48,"stem":49,"status":11},"Discovery Service","\u002Fdocs\u002Fcore-concepts\u002Fdiscovery","1.docs\u002F2.core-concepts\u002F14.discovery",{"title":51,"path":52,"stem":53,"status":11},"Application Lifecycle","\u002Fdocs\u002Fcore-concepts\u002Fapp-lifecycle","1.docs\u002F2.core-concepts\u002F15.app-lifecycle",{"title":55,"path":56,"stem":57,"status":11},"Controllers","\u002Fdocs\u002Fcore-concepts\u002Fcontrollers","1.docs\u002F2.core-concepts\u002F2.controllers",{"title":59,"path":60,"stem":61,"status":11},"Routing","\u002Fdocs\u002Fcore-concepts\u002Frouting","1.docs\u002F2.core-concepts\u002F3.routing",{"title":63,"path":64,"stem":65,"status":11},"Providers","\u002Fdocs\u002Fcore-concepts\u002Fproviders","1.docs\u002F2.core-concepts\u002F4.providers",{"title":67,"path":68,"stem":69,"status":11},"Modules","\u002Fdocs\u002Fcore-concepts\u002Fmodules","1.docs\u002F2.core-concepts\u002F5.modules",{"title":71,"path":72,"stem":73,"status":11},"Configuration","\u002Fdocs\u002Fcore-concepts\u002Fconfiguration","1.docs\u002F2.core-concepts\u002F6.configuration",{"title":75,"path":76,"stem":77,"status":11},"Middleware","\u002Fdocs\u002Fcore-concepts\u002Fmiddleware","1.docs\u002F2.core-concepts\u002F7.middleware",{"title":79,"path":80,"stem":81,"status":11},"Guards","\u002Fdocs\u002Fcore-concepts\u002Fguards","1.docs\u002F2.core-concepts\u002F8.guards",{"title":83,"path":84,"stem":85,"status":11},"Exceptions","\u002Fdocs\u002Fcore-concepts\u002Fexceptions","1.docs\u002F2.core-concepts\u002F9.exceptions",{"title":87,"path":88,"stem":89,"children":90,"status":11,"icon":20},"Packages","\u002Fdocs\u002Fpackages","1.docs\u002F3.packages\u002F1.index",[91,92,97,108,112,130,134,138,142,146,150,154],{"title":27,"path":88,"stem":89,"status":11},{"title":93,"path":94,"stem":95,"status":96},"CLI","\u002Fdocs\u002Fpackages\u002Fcli","1.docs\u002F3.packages\u002F10.cli","experimental",{"title":98,"path":99,"stem":100,"children":101,"status":11,"icon":20,"defaultOpen":20},"Events","\u002Fdocs\u002Fpackages\u002Fmessaging","1.docs\u002F3.packages\u002F11.messaging\u002F1.index",[102,104],{"title":27,"path":99,"stem":100,"status":103},"beta",{"title":105,"path":106,"stem":107,"status":96},"Redis","\u002Fdocs\u002Fpackages\u002Fmessaging\u002Fredis","1.docs\u002F3.packages\u002F11.messaging\u002F2.redis",{"title":109,"path":110,"stem":111,"status":103},"Serve Static","\u002Fdocs\u002Fpackages\u002Fserve-static","1.docs\u002F3.packages\u002F12.serve-static",{"title":113,"path":114,"stem":115,"children":116,"status":11,"icon":20,"defaultOpen":20},"Auth","\u002Fdocs\u002Fpackages\u002Fauth","1.docs\u002F3.packages\u002F2.auth\u002F1.index",[117,118,122,126],{"title":27,"path":114,"stem":115,"status":103},{"title":119,"path":120,"stem":121,"status":103},"JWT Provider","\u002Fdocs\u002Fpackages\u002Fauth\u002Fjwt","1.docs\u002F3.packages\u002F2.auth\u002F2.jwt",{"title":123,"path":124,"stem":125,"status":103},"Local Provider","\u002Fdocs\u002Fpackages\u002Fauth\u002Flocal","1.docs\u002F3.packages\u002F2.auth\u002F3.local",{"title":127,"path":128,"stem":129,"status":96},"OAuth2 Provider","\u002Fdocs\u002Fpackages\u002Fauth\u002Foauth2","1.docs\u002F3.packages\u002F2.auth\u002F4.oauth2",{"title":131,"path":132,"stem":133,"status":103},"JWT","\u002Fdocs\u002Fpackages\u002Fjwt","1.docs\u002F3.packages\u002F3.jwt",{"title":135,"path":136,"stem":137,"status":103},"Drizzle","\u002Fdocs\u002Fpackages\u002Fdrizzle","1.docs\u002F3.packages\u002F4.drizzle",{"title":139,"path":140,"stem":141,"status":103},"Papr","\u002Fdocs\u002Fpackages\u002Fpapr","1.docs\u002F3.packages\u002F5.papr",{"title":143,"path":144,"stem":145,"status":103},"Mongoose","\u002Fdocs\u002Fpackages\u002Fmongoose","1.docs\u002F3.packages\u002F6.mongoose",{"title":147,"path":148,"stem":149,"status":103},"Swagger","\u002Fdocs\u002Fpackages\u002Fswagger","1.docs\u002F3.packages\u002F7.swagger",{"title":151,"path":152,"stem":153,"status":103},"Node Server","\u002Fdocs\u002Fpackages\u002Fnode-server","1.docs\u002F3.packages\u002F8.node-server",{"title":155,"path":156,"stem":157,"status":103},"uWS Server","\u002Fdocs\u002Fpackages\u002Fuws-server","1.docs\u002F3.packages\u002F9.uws-server",{"title":159,"path":160,"stem":161,"children":162,"status":11,"icon":20},"Roadmap","\u002Fdocs\u002Froadmap","1.docs\u002F4.roadmap\u002F1.index",[163,164,168,172],{"title":27,"path":160,"stem":161,"status":11},{"title":165,"path":166,"stem":167,"status":11},"Short term (0-3 months)","\u002Fdocs\u002Froadmap\u002Fshort-term","1.docs\u002F4.roadmap\u002F2.short-term",{"title":169,"path":170,"stem":171,"status":11},"Mid term (3-9 months)","\u002Fdocs\u002Froadmap\u002Fmid-term","1.docs\u002F4.roadmap\u002F3.mid-term",{"title":173,"path":174,"stem":175,"status":11},"Long term (9-12+ months)","\u002Fdocs\u002Froadmap\u002Flong-term","1.docs\u002F4.roadmap\u002F4.long-term",{"id":177,"title":51,"body":178,"description":1142,"extension":1143,"meta":1144,"navigation":881,"path":52,"seo":1145,"status":11,"stem":53,"__hash__":1146},"docs\u002F1.docs\u002F2.core-concepts\u002F15.app-lifecycle.md",{"type":179,"value":180,"toc":1130},"minimark",[181,207,212,227,279,288,370,374,377,423,427,444,495,546,549,554,587,591,602,690,693,730,734,787,791,808,811,1006,1009,1016,1021,1116,1126],[182,183,184,185,189,190,193,194,197,198,202,203,206],"p",{},"A Miia app moves through three phases: ",[186,187,188],"strong",{},"init",", ",[186,191,192],{},"active",", and ",[186,195,196],{},"shutdown",". Knowing what happens in each lets you wire ",[199,200,201],"code",{},"onInit"," \u002F ",[199,204,205],{},"onDestroy"," lifecycle hooks correctly and reason about graceful shutdown under signals like SIGTERM.",[208,209,211],"h2",{"id":210},"init-phase","Init phase",[182,213,214,215,218,219,222,223,226],{},"Triggered by ",[199,216,217],{},"app.listen(port, ...)"," (or ",[199,220,221],{},"app.init()"," directly for embedded scenarios like ",[199,224,225],{},"app.fetch"," in serverless). Sequence:",[228,229,230,241,257],"ol",{},[231,232,233,236,237,240],"li",{},[199,234,235],{},"container.initAll()"," - runs every singleton provider's ",[199,238,239],{},"onInit()"," (if defined). Async, awaited in registration order.",[231,242,243,246,247,249,250,202,253,256],{},[199,244,245],{},"compilePipelines()"," - bakes global middleware + per-route guard\u002Fmiddleware chains into final ",[199,248,75],{}," functions. Cached until invalidated by a new ",[199,251,252],{},"use()",[199,254,255],{},"register()",".",[231,258,259,262,263,266,267,270,271,274,275,278],{},[199,260,261],{},"container.bootstrapAll()"," - runs every singleton's ",[199,264,265],{},"onReady()"," hook. By this point all providers are fully initialised, so handlers like ",[199,268,269],{},"MessageBus.onReady"," can safely call ",[199,272,273],{},"DiscoveryService"," and wire ",[199,276,277],{},"@On"," subscriptions.",[182,280,281,282,285,286,256],{},"Once ",[199,283,284],{},"init()"," returns, the app is ready to accept requests via ",[199,287,225],{},[289,290,295],"pre",{"className":291,"code":292,"language":293,"meta":294,"style":294},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","@Injectable()\nclass DbConnection {\n  async onInit() {\n    await this.connect()\n  }\n}\n","ts","",[199,296,297,314,328,343,358,364],{"__ignoreMap":294},[298,299,302,306,310],"span",{"class":300,"line":301},"line",1,[298,303,305],{"class":304},"sMK4o","@",[298,307,309],{"class":308},"s2Zo4","Injectable",[298,311,313],{"class":312},"sTEyZ","()\n",[298,315,317,321,325],{"class":300,"line":316},2,[298,318,320],{"class":319},"spNyl","class",[298,322,324],{"class":323},"sBMFI"," DbConnection",[298,326,327],{"class":304}," {\n",[298,329,331,334,338,341],{"class":300,"line":330},3,[298,332,333],{"class":319},"  async",[298,335,337],{"class":336},"swJcz"," onInit",[298,339,340],{"class":304},"()",[298,342,327],{"class":304},[298,344,346,350,353,356],{"class":300,"line":345},4,[298,347,349],{"class":348},"s7zQu","    await",[298,351,352],{"class":304}," this.",[298,354,355],{"class":308},"connect",[298,357,313],{"class":336},[298,359,361],{"class":300,"line":360},5,[298,362,363],{"class":304},"  }\n",[298,365,367],{"class":300,"line":366},6,[298,368,369],{"class":304},"}\n",[208,371,373],{"id":372},"active-phase","Active phase",[182,375,376],{},"While the app is running:",[378,379,380,390,403,406],"ul",{},[231,381,382,383,385,386,389],{},"HTTP requests routed through ",[199,384,225],{}," → ",[199,387,388],{},"compose()"," middleware pipeline → controller handler.",[231,391,392,394,395,398,399,402],{},[199,393,277],{}," handlers receive messages via the configured ",[199,396,397],{},"MessageTransport"," (when using ",[199,400,401],{},"@miiajs\u002Fmessaging",").",[231,404,405],{},"Request-scoped DI providers are created on first inject, cleared after the response (per request).",[231,407,408,411,412,415,416,419,420,256],{},[199,409,410],{},"request"," scope vs ",[199,413,414],{},"singleton"," vs ",[199,417,418],{},"transient"," - see ",[421,422,63],"a",{"href":64},[208,424,426],{"id":425},"shutdown-phase","Shutdown phase",[182,428,429,430,433,434,189,437,193,440,443],{},"By default, when ",[199,431,432],{},"app.listen()"," is called, Miia registers handlers for ",[186,435,436],{},"SIGTERM",[186,438,439],{},"SIGINT",[186,441,442],{},"SIGHUP",". On any of those signals, the app:",[228,445,446,452,482],{},[231,447,448,449],{},"Logs ",[199,450,451],{},"[App] Received \u003Csignal>, shutting down gracefully...",[231,453,454,455,458,459],{},"Awaits ",[199,456,457],{},"app.destroy()"," which:\n",[378,460,461,468,477],{},[231,462,463,464,467],{},"Calls ",[199,465,466],{},"closeServer()"," (stops accepting new requests)",[231,469,463,470,262,473,476],{},[199,471,472],{},"container.destroyAll()",[199,474,475],{},"onDestroy()"," (e.g. database disconnect, broker cleanup, in-flight handler drain)",[231,478,448,479],{},[199,480,481],{},"[App] Shutdown complete",[231,483,484,218,487,490,491,494],{},[199,485,486],{},"process.exit(0)",[199,488,489],{},"1"," if ",[199,492,493],{},"destroy()"," throws)",[289,496,498],{"className":291,"code":497,"language":293,"meta":294,"style":294},"@Injectable()\nclass DbConnection {\n  async onDestroy() {\n    await this.disconnect()\n  }\n}\n",[199,499,500,508,516,527,538,542],{"__ignoreMap":294},[298,501,502,504,506],{"class":300,"line":301},[298,503,305],{"class":304},[298,505,309],{"class":308},[298,507,313],{"class":312},[298,509,510,512,514],{"class":300,"line":316},[298,511,320],{"class":319},[298,513,324],{"class":323},[298,515,327],{"class":304},[298,517,518,520,523,525],{"class":300,"line":330},[298,519,333],{"class":319},[298,521,522],{"class":336}," onDestroy",[298,524,340],{"class":304},[298,526,327],{"class":304},[298,528,529,531,533,536],{"class":300,"line":345},[298,530,349],{"class":348},[298,532,352],{"class":304},[298,534,535],{"class":308},"disconnect",[298,537,313],{"class":336},[298,539,540],{"class":300,"line":360},[298,541,363],{"class":304},[298,543,544],{"class":300,"line":366},[298,545,369],{"class":304},[182,547,548],{},"Concurrent signals are guarded: only the first one initiates shutdown. Pressing Ctrl+C twice means the second SIGINT goes to the OS default action (kill the process) - this is conventional Unix behaviour, not a bug.",[550,551,553],"h3",{"id":552},"triggers-in-real-deployments","Triggers in real deployments",[378,555,556,569,575,581],{},[231,557,558,561,562,565,566,568],{},[186,559,560],{},"K8s \u002F Docker stop"," sends SIGTERM, then SIGKILL after ",[199,563,564],{},"terminationGracePeriodSeconds"," (30s default). Fits Miia's flow - ",[199,567,493],{}," runs within the grace period.",[231,570,571,574],{},[186,572,573],{},"systemd stop"," also SIGTERM, similar timing.",[231,576,577,580],{},[186,578,579],{},"Ctrl+C"," in a terminal sends SIGINT.",[231,582,583,586],{},[186,584,585],{},"Closing the terminal"," sends SIGHUP (Unix-only).",[550,588,590],{"id":589},"configuring-shutdown-hooks","Configuring shutdown hooks",[182,592,593,594,597,598,601],{},"The ",[199,595,596],{},"shutdownHooks"," option in ",[199,599,600],{},"MiiaOptions"," controls registration:",[289,603,605],{"className":291,"code":604,"language":293,"meta":294,"style":294},"new Miia()                                     \u002F\u002F default - SIGTERM + SIGINT + SIGHUP\nnew Miia({ shutdownHooks: false })             \u002F\u002F opt out completely\nnew Miia({ shutdownHooks: ['SIGTERM'] })       \u002F\u002F custom signal subset\n",[199,606,607,622,653],{"__ignoreMap":294},[298,608,609,612,615,618],{"class":300,"line":301},[298,610,611],{"class":304},"new",[298,613,614],{"class":308}," Miia",[298,616,617],{"class":312},"()                                     ",[298,619,621],{"class":620},"sHwdD","\u002F\u002F default - SIGTERM + SIGINT + SIGHUP\n",[298,623,624,626,628,631,634,637,640,644,647,650],{"class":300,"line":316},[298,625,611],{"class":304},[298,627,614],{"class":308},[298,629,630],{"class":312},"(",[298,632,633],{"class":304},"{",[298,635,636],{"class":336}," shutdownHooks",[298,638,639],{"class":304},":",[298,641,643],{"class":642},"sfNiH"," false",[298,645,646],{"class":304}," }",[298,648,649],{"class":312},")             ",[298,651,652],{"class":620},"\u002F\u002F opt out completely\n",[298,654,655,657,659,661,663,665,667,670,673,676,678,681,684,687],{"class":300,"line":330},[298,656,611],{"class":304},[298,658,614],{"class":308},[298,660,630],{"class":312},[298,662,633],{"class":304},[298,664,636],{"class":336},[298,666,639],{"class":304},[298,668,669],{"class":312}," [",[298,671,672],{"class":304},"'",[298,674,436],{"class":675},"sfazB",[298,677,672],{"class":304},[298,679,680],{"class":312},"] ",[298,682,683],{"class":304},"}",[298,685,686],{"class":312},")       ",[298,688,689],{"class":620},"\u002F\u002F custom signal subset\n",[182,691,692],{},"When to opt out:",[378,694,695,711,717],{},[231,696,697,700,701,703,704,706,707,710],{},[186,698,699],{},"Serverless"," - if you only use ",[199,702,225],{}," for AWS Lambda \u002F Vercel \u002F Cloudflare Workers, skip ",[199,705,432],{}," entirely. Handlers are not registered (registration happens in ",[199,708,709],{},"listen()",", not constructor).",[231,712,713,716],{},[186,714,715],{},"Multi-Miia processes"," - rare, but possible (e.g. public API + admin worker in one process). See below.",[231,718,719,722,723,726,727,729],{},[186,720,721],{},"Custom bootstrap"," - you have your own ",[199,724,725],{},"process.on('SIGTERM')"," orchestration and want full control over ",[199,728,493],{}," timing.",[550,731,733],{"id":732},"behavioural-details","Behavioural details",[378,735,736,749,763,773],{},[231,737,738,743,744,746,747,256],{},[186,739,740,742],{},[199,741,486],{}," cancels non-awaited timers"," and any remaining open handles after ",[199,745,493],{}," returns. Acceptable trade-off for deterministic exit. If you have long-running background jobs, await them in your own ",[199,748,475],{},[231,750,751,754,755,758,759,762],{},[186,752,753],{},"User signal handlers co-exist"," with Miia's. If you have your own ",[199,756,757],{},"process.on('SIGTERM', ...)"," listener, it still fires alongside Miia's. Pass ",[199,760,761],{},"shutdownHooks: false"," if you want exclusive control.",[231,764,765,768,769,772],{},[186,766,767],{},"Windows: SIGHUP is not supported."," Miia silently filters it out from the default array on ",[199,770,771],{},"process.platform === 'win32'",". SIGTERM and SIGINT remain active.",[231,774,775,783,784,786],{},[186,776,777,780,781],{},[199,778,779],{},"TestApp"," does not call ",[199,782,709],{}," - it goes through ",[199,785,284],{}," directly. So no signal handlers are registered in tests, by construction.",[550,788,790],{"id":789},"multi-miia-in-one-process","Multi-Miia in one process",[182,792,793,794,797,798,801,802,804,805,807],{},"Node delivers each signal to ",[186,795,796],{},"every"," registered listener. If two Miia instances both have ",[199,799,800],{},"shutdownHooks: true",", both start their own ",[199,803,493],{}," concurrently on SIGTERM. The first instance to reach ",[199,806,486],{}," terminates the process; the other's cleanup may be interrupted mid-flight.",[182,809,810],{},"Pattern for two-app processes:",[289,812,814],{"className":291,"code":813,"language":293,"meta":294,"style":294},"const primary = new Miia().register(PublicAppModule)\nconst admin = new Miia({ shutdownHooks: false }).register(AdminAppModule)\n\nawait Promise.all([primary.listen(8080), admin.listen(9090)])\n\n\u002F\u002F Primary owns shutdown signals. When SIGTERM fires, Miia destroys primary\n\u002F\u002F automatically. We register an extra hook to tear down admin first.\nprocess.on('SIGTERM', async () => {\n  await admin.destroy()\n  \u002F\u002F primary.destroy() runs from Miia's own handler immediately after.\n})\n",[199,815,816,842,877,883,930,934,939,945,977,992,998],{"__ignoreMap":294},[298,817,818,821,824,827,830,832,834,836,839],{"class":300,"line":301},[298,819,820],{"class":319},"const",[298,822,823],{"class":312}," primary ",[298,825,826],{"class":304},"=",[298,828,829],{"class":304}," new",[298,831,614],{"class":308},[298,833,340],{"class":312},[298,835,256],{"class":304},[298,837,838],{"class":308},"register",[298,840,841],{"class":312},"(PublicAppModule)\n",[298,843,844,846,849,851,853,855,857,859,861,863,865,867,870,872,874],{"class":300,"line":316},[298,845,820],{"class":319},[298,847,848],{"class":312}," admin ",[298,850,826],{"class":304},[298,852,829],{"class":304},[298,854,614],{"class":308},[298,856,630],{"class":312},[298,858,633],{"class":304},[298,860,636],{"class":336},[298,862,639],{"class":304},[298,864,643],{"class":642},[298,866,646],{"class":304},[298,868,869],{"class":312},")",[298,871,256],{"class":304},[298,873,838],{"class":308},[298,875,876],{"class":312},"(AdminAppModule)\n",[298,878,879],{"class":300,"line":330},[298,880,882],{"emptyLinePlaceholder":881},true,"\n",[298,884,885,888,891,893,896,899,901,904,906,910,912,915,918,920,922,924,927],{"class":300,"line":345},[298,886,887],{"class":348},"await",[298,889,890],{"class":323}," Promise",[298,892,256],{"class":304},[298,894,895],{"class":308},"all",[298,897,898],{"class":312},"([primary",[298,900,256],{"class":304},[298,902,903],{"class":308},"listen",[298,905,630],{"class":312},[298,907,909],{"class":908},"sbssI","8080",[298,911,869],{"class":312},[298,913,914],{"class":304},",",[298,916,917],{"class":312}," admin",[298,919,256],{"class":304},[298,921,903],{"class":308},[298,923,630],{"class":312},[298,925,926],{"class":908},"9090",[298,928,929],{"class":312},")])\n",[298,931,932],{"class":300,"line":360},[298,933,882],{"emptyLinePlaceholder":881},[298,935,936],{"class":300,"line":366},[298,937,938],{"class":620},"\u002F\u002F Primary owns shutdown signals. When SIGTERM fires, Miia destroys primary\n",[298,940,942],{"class":300,"line":941},7,[298,943,944],{"class":620},"\u002F\u002F automatically. We register an extra hook to tear down admin first.\n",[298,946,948,951,953,956,958,960,962,964,966,969,972,975],{"class":300,"line":947},8,[298,949,950],{"class":312},"process",[298,952,256],{"class":304},[298,954,955],{"class":308},"on",[298,957,630],{"class":312},[298,959,672],{"class":304},[298,961,436],{"class":675},[298,963,672],{"class":304},[298,965,914],{"class":304},[298,967,968],{"class":319}," async",[298,970,971],{"class":304}," ()",[298,973,974],{"class":319}," =>",[298,976,327],{"class":304},[298,978,980,983,985,987,990],{"class":300,"line":979},9,[298,981,982],{"class":348},"  await",[298,984,917],{"class":312},[298,986,256],{"class":304},[298,988,989],{"class":308},"destroy",[298,991,313],{"class":336},[298,993,995],{"class":300,"line":994},10,[298,996,997],{"class":620},"  \u002F\u002F primary.destroy() runs from Miia's own handler immediately after.\n",[298,999,1001,1003],{"class":300,"line":1000},11,[298,1002,683],{"class":304},[298,1004,1005],{"class":312},")\n",[182,1007,1008],{},"Alternative: both opt out, register your own coordinator.",[208,1010,1012,1013,1015],{"id":1011},"embedded-appfetch-serverless","Embedded ",[199,1014,225],{}," (serverless)",[182,1017,1018,1019,639],{},"For environments where the runtime owns the request loop (Lambda, Cloudflare Workers, Vercel Edge), do not call ",[199,1020,432],{},[289,1022,1024],{"className":291,"code":1023,"language":293,"meta":294,"style":294},"const app = new Miia({ shutdownHooks: false })\n  .register(AppModule)\n\nawait app.init()  \u002F\u002F explicit - normally called by listen()\n\nexport default { fetch: app.fetch }  \u002F\u002F platform handler\n",[199,1025,1026,1053,1063,1067,1084,1088],{"__ignoreMap":294},[298,1027,1028,1030,1033,1035,1037,1039,1041,1043,1045,1047,1049,1051],{"class":300,"line":301},[298,1029,820],{"class":319},[298,1031,1032],{"class":312}," app ",[298,1034,826],{"class":304},[298,1036,829],{"class":304},[298,1038,614],{"class":308},[298,1040,630],{"class":312},[298,1042,633],{"class":304},[298,1044,636],{"class":336},[298,1046,639],{"class":304},[298,1048,643],{"class":642},[298,1050,646],{"class":304},[298,1052,1005],{"class":312},[298,1054,1055,1058,1060],{"class":300,"line":316},[298,1056,1057],{"class":304},"  .",[298,1059,838],{"class":308},[298,1061,1062],{"class":312},"(AppModule)\n",[298,1064,1065],{"class":300,"line":330},[298,1066,882],{"emptyLinePlaceholder":881},[298,1068,1069,1071,1074,1076,1078,1081],{"class":300,"line":345},[298,1070,887],{"class":348},[298,1072,1073],{"class":312}," app",[298,1075,256],{"class":304},[298,1077,188],{"class":308},[298,1079,1080],{"class":312},"()  ",[298,1082,1083],{"class":620},"\u002F\u002F explicit - normally called by listen()\n",[298,1085,1086],{"class":300,"line":360},[298,1087,882],{"emptyLinePlaceholder":881},[298,1089,1090,1093,1096,1099,1102,1104,1106,1108,1111,1113],{"class":300,"line":366},[298,1091,1092],{"class":348},"export",[298,1094,1095],{"class":348}," default",[298,1097,1098],{"class":304}," {",[298,1100,1101],{"class":336}," fetch",[298,1103,639],{"class":304},[298,1105,1073],{"class":312},[298,1107,256],{"class":304},[298,1109,1110],{"class":312},"fetch ",[298,1112,683],{"class":304},[298,1114,1115],{"class":620},"  \u002F\u002F platform handler\n",[182,1117,1118,1120,1121,1123,1124,256],{},[199,1119,761],{}," is recommended here - the platform manages signals itself, and serverless handlers are short-lived. If you skip the option, no harm done either: signal handlers are only registered in ",[199,1122,709],{},", not in ",[199,1125,284],{},[1127,1128,1129],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":294,"searchDepth":316,"depth":316,"links":1131},[1132,1133,1134,1140],{"id":210,"depth":316,"text":211},{"id":372,"depth":316,"text":373},{"id":425,"depth":316,"text":426,"children":1135},[1136,1137,1138,1139],{"id":552,"depth":330,"text":553},{"id":589,"depth":330,"text":590},{"id":732,"depth":330,"text":733},{"id":789,"depth":330,"text":790},{"id":1011,"depth":316,"text":1141},"Embedded app.fetch (serverless)","Init, active, and shutdown phases of a Miia app - graceful destroy on SIGTERM\u002FSIGINT\u002FSIGHUP by default.","md",{},{"title":51,"description":1142},"MqkTBXL05zwUHCl_6zKGw0cW4AX3s2SrI7RQWQM71MU",[1148,1150],{"title":47,"path":48,"stem":49,"description":1149,"children":-1},"Scan every singleton provider for decorator metadata at startup - the foundation of ambient discovery in MiiaJS.",{"title":55,"path":56,"stem":57,"description":1151,"children":-1},"Handle incoming HTTP requests and define your API routes.",1778575270760]