Created
May 25, 2024 08:47
-
-
Save mikeesto/d66eac79b22da333f947cf05dafdd8c9 to your computer and use it in GitHub Desktop.
Fal.ai hide prompt nextjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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