Skip to content

Hello World

A minimal worker that returns a JSON response.

src/index.ts
import type { ExportedHandler } from "kyushu-types";
export default {
async fetch() {
return {
status: 200,
headers: { "content-type": "application/json" },
body: JSON.stringify({ hello: "world" }),
};
},
} satisfies ExportedHandler;

Try it

Build and run the worker.

Terminal window
kyu build && kyu run

Then send a request to test it.

Terminal window
curl http://localhost:5987