import { NextRequest, NextResponse } from "next/server";
import bcrypt from "bcrypt"

export async function GET(request: NextRequest) {
  const searchParams = request.nextUrl.searchParams;
  const password = searchParams.get('password') ?? '';
  const hash = await bcrypt.hash(password, 10);

  return NextResponse.json({ hash });
}