try auth a bit
This commit is contained in:
parent
a3c5d1b588
commit
9be5321d48
|
@ -7,9 +7,20 @@ app.get("/", (c) => {
|
||||||
return c.text("Hi from hono updated");
|
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
|
// c.env.LINGDOCS_COUCHDB
|
||||||
return c.text("Hi other route");
|
return c.json({ ok, user });
|
||||||
});
|
});
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
|
Loading…
Reference in New Issue