The data to be serialized as JSON.
Optional response initialization options.
A Response object with the specified JSON content.
Example usage:
import { start, router, json } from "@pulsar-http/core";
const routes = [
router.get("/api/users", async () => json({ users: [] })),
];
start({ routes });
In this example, the response will have a JSON body with the content { "users": [] }
.
Creates a JSON response.