fix: remote webhooks

This commit is contained in:
Andras Bacsai
2022-11-04 09:58:37 +01:00
parent 1b02f9bd5d
commit bf33d6c34e
3 changed files with 31 additions and 8 deletions

View File

@@ -1,13 +1,12 @@
import { FastifyPluginAsync } from 'fastify';
import { OnlyId } from '../../../types';
import { proxyConfiguration, traefikConfiguration, traefikOtherConfiguration } from './handlers';
import { TraefikOtherConfiguration } from './types';
import { proxyConfiguration, otherProxyConfiguration } from './handlers';
import { OtherProxyConfiguration } from './types';
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
fastify.get<OnlyId>('/main.json', async (request, reply) => proxyConfiguration(request, false));
fastify.get<OnlyId>('/test', async (request, reply) => proxyConfiguration(request, false));
fastify.get<OnlyId>('/remote/:id', async (request) => traefikConfiguration(request, true));
fastify.get<TraefikOtherConfiguration>('/other.json', async (request, reply) => traefikOtherConfiguration(request));
fastify.get<OnlyId>('/remote/:id', async (request) => proxyConfiguration(request, true));
fastify.get<OtherProxyConfiguration>('/other.json', async (request, reply) => otherProxyConfiguration(request));
};
export default root;