riffusion-app/pages/api/baseten.js

17 lines
437 B
JavaScript
Raw Normal View History

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": "*",
"Authorization": `Api-Key ${process.env.RIFFUSION_BASETEN_API_KEY}`
2022-12-11 23:51:40 -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 });
}