import { saveToTana } from "https://esm.town/v/impedivity/saveToTana";
import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes";
import { Hono } from "npm:hono";
const token = Deno.env.get("tanaInputAPI");
export const honoTanaEndpoint = async (req: Request) => {
const app = new Hono();
app.get("/", async (c) => {
let { text, url } = c.req.query();
console.log(c.req);
const payload: APIPlainNode = {
name: text,
children: [
],
supertags: [{ "id": "_Rggv-uS-spa" }],
};
console.log("2");
const newNode = await saveToTana(token, payload);
return c.json({ newNode });
});
return app.fetch(req);
};