import express from "express";
import fetch from "node-fetch";
const app = express();
app.use(express.json());
app.post("/ryan", async (req, res) => {
const r = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.OPENAI_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify(req.body)
});
const data = await r.json();
res.json(data);
});
app.listen(3000);