riffusion-app/pages/api/baseten.js

19 lines
541 B
JavaScript

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}`
};
// This code is no longer active in favor of blueprint method
const response = await fetch(process.env.RIFFUSION_BASETEN_URL, {
method: "POST",
headers: headers,
body: req.body,
signal: AbortSignal.timeout(20000),
});
const data = await response.json();
res.status(200).json({ data });
}