Files
webapp-text-generator/app/api/workflows/run/route.ts
T
KVOJJJin 68dee014e7 Feat: support workflow (#20)
* chore: fix version of Next.js

* workflow run api supported

* support workflow process

* add scripts of editor
2024-04-23 16:09:48 +08:00

14 lines
379 B
TypeScript

import { type NextRequest } from 'next/server'
import { client, getInfo } from '@/app/api/utils/common'
export async function POST(request: NextRequest) {
const body = await request.json()
const {
inputs,
files,
} = body
const { user } = getInfo(request)
const res = await client.runWorkflow(inputs, user, true, files)
return new Response(res.data as any)
}