import { NextRequest } from "next/server";
import { stringify } from "node:querystring";

export async function GET(request: NextRequest) {
  return Response.json(
    await fetch(
      `https://s.abtmtr.link/autocompleter?${stringify({
        q: request.nextUrl.searchParams.get("q")
      })}`
    ).then(x => x.json())
  );
}