API
DirectoryFast is built on the latest NextJs features, including the App router.
Last updated
DirectoryFast is built on the latest NextJs features, including the App router.
Last updated
All your "backend" stuff is located in the /api
folder.
Any route.ts
file will be an API endpoint, and the folder route will be the final API route. You can define dynamic content as well:
/api/products
/products
/api/products/newest
/products/newest
/api/products/[slug]
/products/the-best-product
/api/category/[id]/products
/category/1337/products
API calls are handled by , a powerful and simple library that handle cache, background updates or stale data out of the box.
GET example:
POST example: