fix: more types for API

This commit is contained in:
Andras Bacsai
2022-07-14 12:47:26 +00:00
parent ce31146a9c
commit 90597389c9
40 changed files with 722 additions and 316 deletions

View File

@@ -1,10 +1,12 @@
import { FastifyPluginAsync } from 'fastify';
import { configureGitHubApp, gitHubEvents, installGithub } from './handlers';
const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
import type { GitHubEvents, InstallGithub } from './types';
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
fastify.get('/', async (request, reply) => configureGitHubApp(request, reply));
fastify.get('/install', async (request, reply) => installGithub(request, reply));
fastify.post('/events', async (request, reply) => gitHubEvents(request, reply));
fastify.get<InstallGithub>('/install', async (request, reply) => installGithub(request, reply));
fastify.post<GitHubEvents>('/events', async (request, reply) => gitHubEvents(request));
};
export default root;