Skip to content

Commit

Permalink
try auth a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
adueck committed Nov 26, 2024
1 parent a3c5d1b commit 9be5321
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions new-functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 9be5321

Please sign in to comment.