import { FastifyPluginAsync } from "fastify";
import { Handler } from "../../modules/elephantfy/useCases/WebHook/Handler";

const elephantfy: FastifyPluginAsync = async (fastify, opts) => {
  fastify.post("/webhook", async (request, reply) => {
    const handler = new Handler(fastify);
    return handler.execute(request, reply);
  });
};

export default elephantfy;