2025-12-11 10:40:55 +01:00
|
|
|
/*
|
2026-01-12 15:00:36 +01:00
|
|
|
* Copyright (c) 2026 by Christian Kellner.
|
2025-12-11 10:40:55 +01:00
|
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-13 13:42:43 +01:00
|
|
|
import fs from 'fs';
|
2026-04-27 16:56:04 +02:00
|
|
|
|
2021-01-21 16:09:23 +01:00
|
|
|
const providerList = fs.readdirSync('./lib/provider').filter((file) => file.endsWith('.js'));
|
2026-04-27 16:56:04 +02:00
|
|
|
const providers = await Promise.all(providerList.map(async (pro) => import(`../../provider/${pro}`)));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {import('fastify').FastifyInstance} fastify
|
|
|
|
|
*/
|
|
|
|
|
export default async function providerPlugin(fastify) {
|
|
|
|
|
fastify.get('/', async () => {
|
|
|
|
|
return providers.map((p) => p.metaInformation);
|
|
|
|
|
});
|
|
|
|
|
}
|