21 lines
462 B
TypeScript
21 lines
462 B
TypeScript
import type { FastifyPluginCallback } from 'fastify';
|
|
import * as controller from '@/controllers/webhook.controller';
|
|
|
|
const webhookRouter: FastifyPluginCallback = async (fastify) => {
|
|
fastify.route({
|
|
method: 'GET',
|
|
url: '/slack',
|
|
handler: controller.slackWebhook,
|
|
});
|
|
fastify.route({
|
|
method: 'POST',
|
|
url: '/polar',
|
|
handler: controller.polarWebhook,
|
|
config: {
|
|
rawBody: true,
|
|
},
|
|
});
|
|
};
|
|
|
|
export default webhookRouter;
|