try auth a bit

This commit is contained in:
adueck 2024-11-26 16:53:45 +05:00
parent a3c5d1b588
commit 9be5321d48
1 changed files with 13 additions and 2 deletions

View File

@ -7,9 +7,20 @@ app.get("/", (c) => {
return c.text("Hi from hono updated");
});
app.get("/wa", (c) => {
app.get("/wa", async (c) => {
const cookie = c.req.header("Cookie") || "";
const r = await fetch("https://account.lingdocs.com/api/user", {
headers: { cookie },
});
const { ok, user } = await r.json();
// const {
// headers: { cookie },
// } = c. req;
// if (!cookie) {
// return { req: null, res };
// }
// c.env.LINGDOCS_COUCHDB
return c.text("Hi other route");
return c.json({ ok, user });
});
export default app;