How do i use the api-path for pages?
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
I am working on a page, using next.js where (among other things), we want to document an api, in the
/api path. How do I use this path for pages, without it becoming an api in next.js?7 Replies
(possible, but you have to do crazy things like making it an api route returning html as the response, and that html isn't part of the react application etc, so basically you can consider it impossible)
OH wait
i think you can do it like this
make your api routes in /api as normal, but api documentation at /api-docs
then use middleware or next.config.js to rewrite from /api to /api-docs for documentation routes
Giant pandaOP
ok. we will look into that. thanks ðŸ‘