Elysia plugin to create or forward Request IDs.
bun add --exact elysia-requestid
import { requestID } from "elysia-requestid"; // 1. Import
import Elysia from "elysia";
new Elysia()
.use(requestID()) // 2. Use
.get("/", ({ requestID }) => {
return `Hello ${requestID}`; // 3. Available in Context
})
.listen(3000);
requestID({
// The function to use to generate a request ID
uuid: crypto.randomUUID,
// The header to use for the request ID
header: "X-Request-ID",
});