forked from pinks/eris
1
0
Fork 0
eris/api/jobsRoute.ts

16 lines
394 B
TypeScript

import { createEndpoint, createMethodFilter } from "t_rest/server";
import { generationQueue } from "../app/generationQueue.ts";
export const jobsRoute = createMethodFilter({
GET: createEndpoint(
{ query: null, body: null },
async () => ({
status: 200,
body: {
type: "application/json",
data: await generationQueue.getAllJobs(),
},
}),
),
});