2022-07-06 09:02:36 +00:00
|
|
|
import { FastifyPluginAsync } from 'fastify';
|
2022-09-06 07:30:13 +00:00
|
|
|
import { OnlyId } from '../../../types';
|
2022-11-04 08:58:37 +00:00
|
|
|
import { proxyConfiguration, otherProxyConfiguration } from './handlers';
|
|
|
|
|
import { OtherProxyConfiguration } from './types';
|
2022-07-06 09:02:36 +00:00
|
|
|
|
2022-07-14 12:47:26 +00:00
|
|
|
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
2022-11-04 08:54:13 +00:00
|
|
|
fastify.get<OnlyId>('/main.json', async (request, reply) => proxyConfiguration(request, false));
|
2022-11-04 08:58:37 +00:00
|
|
|
fastify.get<OnlyId>('/remote/:id', async (request) => proxyConfiguration(request, true));
|
|
|
|
|
fastify.get<OtherProxyConfiguration>('/other.json', async (request, reply) => otherProxyConfiguration(request));
|
2022-07-06 09:02:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default root;
|