Skip to content

Instantly share code, notes, and snippets.

@uratmangun
Created February 16, 2024 14:04
Show Gist options
  • Save uratmangun/c6421b58d0bbb28223378f17c1fc423c to your computer and use it in GitHub Desktop.
Save uratmangun/c6421b58d0bbb28223378f17c1fc423c to your computer and use it in GitHub Desktop.
index.tsx
import addJobToQueue from "~/utils/bullmq/queue";
const imageBuffer = fs.readFileSync(
path.resolve("./src/media/sorry.png"),
);
export const onGet: RequestHandler = async ({ params, send }) => {
const fileName = path.resolve("./src/media/" + params.id);
try {
const data = { jobName: "create-image", id: params.id };
addJobToQueue(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment