mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
19 lines
562 B
JavaScript
19 lines
562 B
JavaScript
/*
|
|
* Copyright (c) 2026 by Christian Kellner.
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
|
*/
|
|
|
|
import fs from 'fs';
|
|
|
|
const providerList = fs.readdirSync('./lib/provider').filter((file) => file.endsWith('.js'));
|
|
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);
|
|
});
|
|
}
|