leblebijs/example/index.ts

18 lines
265 B
TypeScript
Raw Normal View History

2022-05-21 21:36:48 -05:00
import { endpoint } from "../src";
import { startServer } from "../src/core/server";
2022-05-21 02:31:26 -05:00
2022-05-21 21:36:48 -05:00
type Data = {
name: string;
};
startServer(
endpoint<void, Data>(async (req) => {
return {
status: 200,
body: {
name: "foo",
},
};
}),
);