49 lines
901 B
TypeScript
49 lines
901 B
TypeScript
import type { FastifyPluginCallback } from 'fastify';
|
|
import * as controller from '@/controllers/misc.controller';
|
|
|
|
const miscRouter: FastifyPluginCallback = async (fastify) => {
|
|
fastify.route({
|
|
method: 'POST',
|
|
url: '/ping',
|
|
handler: controller.ping,
|
|
});
|
|
|
|
fastify.route({
|
|
method: 'GET',
|
|
url: '/stats',
|
|
handler: controller.stats,
|
|
});
|
|
|
|
fastify.route({
|
|
method: 'GET',
|
|
url: '/favicon',
|
|
handler: controller.getFavicon,
|
|
});
|
|
|
|
fastify.route({
|
|
method: 'GET',
|
|
url: '/og',
|
|
handler: controller.getOgImage,
|
|
});
|
|
|
|
fastify.route({
|
|
method: 'GET',
|
|
url: '/og/clear',
|
|
handler: controller.clearOgImages,
|
|
});
|
|
|
|
fastify.route({
|
|
method: 'GET',
|
|
url: '/favicon/clear',
|
|
handler: controller.clearFavicons,
|
|
});
|
|
|
|
fastify.route({
|
|
method: 'GET',
|
|
url: '/geo',
|
|
handler: controller.getGeo,
|
|
});
|
|
};
|
|
|
|
export default miscRouter;
|