silverbullet/plugos/test_func.test.ts

18 lines
443 B
TypeScript
Raw Permalink Normal View History

2023-04-19 16:46:20 +08:00
import * as YAML from "https://deno.land/std@0.184.0/yaml/mod.ts";
2023-08-12 02:37:13 +08:00
import { EndpointRequest, EndpointResponse } from "./hooks/endpoint.ts";
export function hello() {
console.log(YAML.stringify({ hello: "world" }));
return "hello";
}
2023-08-12 02:37:13 +08:00
export function endpoint(req: EndpointRequest): EndpointResponse {
console.log("Req", req);
return {
status: 200,
body: [1, 2, 3],
headers: { "Content-type": "application/json" },
};
}