Getting started
Start with one route.
Move a single promise into the request that owns it. Add resources and delivery scopes only when the route needs them.
Install
npm install neloCreate a route
import { Nelo } from "nelo"
import { serve } from "nelo/node"
const app = new Nelo()
app.get("/report", async (context) => {
const report = context.fork(
"report",
(signal) => buildReport({ signal }),
)
return context.json(await report)
})
await serve(app, { port: 3000 }).listen()What Nelo owns
- The child promise has a stable name and parent.
- The request signal reaches the child task.
- The scope waits for a settled outcome instead of leaving work behind.