proxy-detection/src/routes.ts
2025-06-07 16:27:47 -04:00

35 lines
867 B
TypeScript

/**
* Route definitions for the proxy detection API
*/
import { FastifyInstance } from 'fastify';
import {
healthHandler,
mainHandler,
randomHandler,
allHandler,
detailedDebugHandler
} from './handlers';
/**
* Register all routes with the Fastify instance
*/
export async function registerRoutes(fastify: FastifyInstance) {
// Health check endpoint (bypasses authentication)
fastify.get('/health', healthHandler);
// Detailed debug endpoint (bypasses authentication)
fastify.get('/ip-debug-detailed', detailedDebugHandler);
// Random endpoint for testing
fastify.get('/random', randomHandler);
// All endpoint for testing
fastify.get('/all', allHandler);
// All endpoint for testing
fastify.get('/clear', clearHandler);
// Main detection endpoint - extracts all IPs from headers
fastify.get('/', mainHandler);
}