> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-support-migration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Return JSON

> In cases where you need to respond with JSON data, for instance, to simulate an API endpoint or return configuration data, this example illustrates how to create a JSON response. See example below:

```ts theme={null}
import * as BunnySDK from "@bunny.net/edgescript-sdk";

BunnySDK.net.http.serve(
  async (request: Request): Response | Promise<Response> => {
    const data = {
      weather: "sunny",
      temperature: 27,
      windspeed: 0,
      uvindex: 7,
    };

    const json = JSON.stringify(data);

    return new Response(json, {
      headers: {
        "content-type": "application/json",
      },
    });
  },
);
```
