1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { updateTaskAsana } from "https://esm.town/v/ayrtonlacerda/updateTaskAsana";
export const api = async (req: Request) => {
const { Hono } = await import("npm:hono");
const app = new Hono();
app.get("/", (c) =>
c.json({
ok: true,
message: "Hello Hono!",
}));
app.post("/", (c) =>
c.json({
ok: true,
message: "Hello Hono Post!",
}));
app.put("/task/:id", async (c) => {
const body = await c.req.json();
const id = await c.req.param().id;
const data = await updateTaskAsana(id, body);
return c.json({
ok: true,
data: data,
});
});
return app.fetch(req);
};