import{createServer as c}from"http";import*as s from"process";var g=t=>new Promise((o,n)=>{let r="";t.on("data",e=>r+=e),t.on("end",()=>o(r)),t.on("error",e=>n(e))}),d=(t,o)=>{let n=o||13714,r={"/health":async()=>({status:"OK",timestamp:Date.now()}),"/shutdown":()=>s.exit(),"/render":async e=>t(JSON.parse(await g(e))),"/404":async()=>({status:"NOT_FOUND",timestamp:Date.now()})};c(async(e,a)=>{let i=r[e.url]||r["/404"];try{a.writeHead(200,{"Content-Type":"application/json",Server:"Inertia.js SSR"}),a.write(JSON.stringify(await i(e)))}catch(p){console.error(p)}a.end()}).listen(n,()=>console.log("Inertia SSR server started.")),console.log(`Starting SSR server on port ${n}...`)};export{d as default};
//# sourceMappingURL=server.esm.js.map
