And index.js as
```
import { toNodeHandler } from "better-auth/node";
import { auth } from "./auth.js";
import { fromNodeHeaders } from "better-auth/node";
const app = express();
const port = 3000;
app.all("/api/auth/*splat", toNodeHandler(auth));
app.get("/", (req, res) => {
res.send("Hello World!");
});
app.get("/api/me", async (req, res) => {
const headers = fromNodeHeaders(req.headers);
const session = await auth.api.getSession({ headers });
return res.json(session);
});
app.listen(port, () => {
console.log(
And index.js as
```
import { toNodeHandler } from "better-auth/node";
import { auth } from "./auth.js";
import { fromNodeHeaders } from "better-auth/node";
const app = express();
const port = 3000;
app.all("/api/auth/*splat", toNodeHandler(auth));
app.get("/", (req, res) => {
res.send("Hello World!");
});
app.get("/api/me", async (req, res) => {
const headers = fromNodeHeaders(req.headers);
const session = await auth.api.getSession({ headers });
return res.json(session);
});
app.listen(port, () => {
console.log(