Nuxt Server
up:: Nuxt ⚐
API
You can create a folder structure like so:
server/
api/
getBooks.js
In getBooks.js
You can make an api call:
In the script setup of any page:
The benefit of doing that instead of in a Nuxt Pages script setup
function is that private API keys remain hidden.
This also work with Nuxt Dynamic routes to pass in query parameters in the url.