import { NextResponse } from 'next/server';
import { withErrorHandler } from '@server/middleware/withErrorHandler';
import { withAuth, AuthedRequest } from '@server/middleware/withAuth';
import { getActiveGateways } from '@server/services/gateway.service';

export const GET = withErrorHandler(
  withAuth(async (_req: AuthedRequest) => {
    const gateways = await getActiveGateways();
    return NextResponse.json({ gateways });
  })
);
