2022-12-11 23:51:40 -07:00
|
|
|
export default async function handler(req, res) {
|
|
|
|
let headers = {
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
"Access-Control-Allow-Origin": "*",
|
2022-12-12 19:23:03 -07:00
|
|
|
"Authorization": `Api-Key ${process.env.RIFFUSION_BASETEN_API_KEY}`
|
2022-12-11 23:51:40 -07:00
|
|
|
};
|
|
|
|
|
2022-12-12 19:23:03 -07:00
|
|
|
const response = await fetch(process.env.RIFFUSION_BASETEN_URL, {
|
2022-12-11 23:51:40 -07:00
|
|
|
method: "POST",
|
|
|
|
headers: headers,
|
|
|
|
body: req.body,
|
|
|
|
});
|
|
|
|
|
|
|
|
const data = await response.json();
|
|
|
|
res.status(200).json({ data });
|
2022-12-12 19:23:03 -07:00
|
|
|
}
|