import type { APIRoute } from "astro";

export const POST: APIRoute = async({ request }) => {
    const data = await request.json();

    const username = data["username"];
    const email = data["email"];
    const passwordOne = data["password"];
    const passwordTwo = data["passwordverify"];

    console.log(data)
    // console.log(passwordTwo)

    if(username === undefined || email === undefined || passwordOne === undefined || passwordTwo === undefined) return new Response(JSON.stringify({code:400,message:"Bad request"}),{status: 400});
    // console.log(username)

    return new Response(
        JSON.stringify({
            code: 200,
            message: "OK"
        }), { status: 200 }
    )
}