File size: 447 Bytes
43dd1ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import type { NextApiRequest, NextApiResponse } from "next"

import { VideoTask } from "@/app/types"
import { NextResponse } from "next/server"
import { getTask } from "@/server"

// TODO: implement some kind of quota system
export async function GET(
  req: NextApiRequest,
  res: NextApiResponse<{
    task?: VideoTask
    error?: string
  }>
) {
  return NextResponse.json({
    task: await getTask(`${req.url?.split('/').pop() || ""}`)
  })
}