app/api/users/route.ts exporting async function GET(request: Request)app/api/users/route.ts exporting async function GET(request: Request) is correct. Route Handlers live in a route.ts file and export functions named after HTTP methods, such as GET and POST. The tempting app/api/users/index.ts with a default export is wrong: default-exported handlers belong to the Pages Router's pages/api folder.
Read more