import { createApp, eventHandler, toNodeListener } from "h3";
import { serve } from "@novu/framework/h3";
import { createServer } from "node:http";
import { myWorkflow } from "./novu/workflows";

const app = createApp();
app.use(
  "/api/novu",
  eventHandler(
    serve({
      workflows: [myWorkflow],
    })
  )
);

createServer(toNodeListener(app)).listen(process.env.PORT || 3000);