mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-17 12:33:06 +00:00
15 lines
443 B
TypeScript
15 lines
443 B
TypeScript
import { FastifyPluginAsync } from 'fastify';
|
|
import { listServers, showUsage } from './handlers';
|
|
|
|
|
|
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
|
fastify.addHook('onRequest', async (request) => {
|
|
return await request.jwtVerify()
|
|
})
|
|
fastify.get('/', async (request) => await listServers(request));
|
|
fastify.get('/usage/:id', async (request) => await showUsage(request));
|
|
|
|
};
|
|
|
|
export default root;
|