leblebijs/example/index.ts

18 lines
265 B
TypeScript

import { endpoint } from "../src";
import { startServer } from "../src/core/server";
type Data = {
name: string;
};
startServer(
endpoint<void, Data>(async (req) => {
return {
status: 200,
body: {
name: "foo",
},
};
}),
);