Skip to content

Instantly share code, notes, and snippets.

@mikeesto
Created May 25, 2024 08:47
Show Gist options
  • Save mikeesto/d66eac79b22da333f947cf05dafdd8c9 to your computer and use it in GitHub Desktop.
Save mikeesto/d66eac79b22da333f947cf05dafdd8c9 to your computer and use it in GitHub Desktop.
Fal.ai hide prompt nextjs
// app/api/fal/proxy/route.js
import { route } from "@fal-ai/serverless-proxy/nextjs";
export const POST = async (req) => {
const body = await req.json();
const modifiedBody = {
...body,
prompt: `an illustration of a ${body.input} in the style of Vincent van Gogh`,
};
const modifiedReq = new Request(req.url, {
method: req.method,
headers: req.headers,
body: JSON.stringify(modifiedBody),
});
return route.POST(modifiedReq);
};
export const GET = route.GET;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment