#Request to /app/api from a page on site

2 messages · Page 1 of 1 (latest)

split plume
#

If I have an API on my site used to fetch data from a database, located within @/app/api, and I have a page on the site that needs to fetch data from that api in @/app/item/[id]/page.js, is it possible to tell the page to fetch it from the API on the site without having to specify the whole domain the site will be on?
I mainly ask as if I'm developing a part of the API alongside the page for it, I need to push the API to my online deployment rather than being able to test it locally on next dev

Using next.js 13.2

#

Request to /app/api from a page on site