Files
andris-carservice/src/app/api/lookup/route.ts
T
Hermes f7a9906add
Build and publish images / docker (push) Canceled after 0s
carservice: initial commit
2026-07-20 20:51:23 +01:00

12 lines
384 B
TypeScript

import { lookupVehicle } from "@/lib/vehicle-lookup";
import { errorResponse, jsonResponse } from "@/lib/api-helpers";
export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
const reg = searchParams.get("reg")?.trim();
if (!reg) return errorResponse("reg is required");
const result = await lookupVehicle(reg);
return jsonResponse(result);
}