File size: 411 Bytes
702763e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { NextResponse } from "next/server";

export async function POST(req: Request) {
  const body = await req.json();
  console.log(body);

  // fetch the user's username from the body
  const { username } = body;

  // fetch user from hugging face API
  const user = await fetch(`https://huggingface.co/api/users/${username}`);

  console.log(user);
  
  return NextResponse.json({ message: "Roasted!" });
}