Need a custom webhook, mobile app endpoint, or JSON API? Create a file named route.js inside app/api/ and export functions named after HTTP methods (GET, POST, PUT, DELETE).
Remember: a folder can have either a page.jsx or a route.js, never both in the exact same folder.
ADVERTISEMENT