Tag:snippet
All posts with the tag "snippet".
Using Next.js API routes
Posted on:December 3, 2020 at 10:00 PMNext.JS comes with a useful feature out of the box, api routes. Files created in the `pages/api/` folder are treated as an endpoint rather than a page. Instead of exporting a React component to display your UI, you can export a function returning, say, a JSON response.