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

16 lines
394 B
TypeScript
Raw Normal View History

2023-10-08 21:23:54 +00:00
import { createEndpoint, createMethodFilter } from "t_rest/server";
2023-10-05 09:00:51 +00:00
import { generationQueue } from "../app/generationQueue.ts";
2023-10-08 21:23:54 +00:00
export const jobsRoute = createMethodFilter({
GET: createEndpoint(
2023-10-05 09:00:51 +00:00
{ query: null, body: null },
async () => ({
status: 200,
2023-10-08 21:23:54 +00:00
body: {
type: "application/json",
data: await generationQueue.getAllJobs(),
},
2023-10-05 09:00:51 +00:00
}),
),
2023-10-08 21:23:54 +00:00
});