Route Handlers yaiku cara App Router kanggo nggawe endpoint API — backend HTTP handlers sing ana ing proyek Next.js mu. Sampeyan nggawe mau kanthi file route.ts, nolak fungsi sing dinamingi miturut HTTP methods.
Nggawe endpoint
ts
{ , } ;
() {
users = db..();
.(users);
}
() {
body = req.();
user = db..({ : body });
.(user, { : });
}
