Can't the server directory be used in SSG?
Hi, I am a company slave who was pushed into a corner just before the release of the product.
We are using CMS and developing with nuxt3.
I am developing with SSG, but the client does not want to display the path to the external API, so I have implemented a search implementation that usesFetch to get a list of the original data and then creates server/api/search.js in nuxt and calls this as the internal API to filter the data. The search is then performed by calling this internal API for filtering.
Now, here is the problem... when I generate npx, an error occurs and server/api/search.js is no longer available.
Can't I use server/hogehoge in the SSG environment?
If not, I would appreciate it if you could give me an alternative.
(https://nuxt.com/docs/guide/directory-structure/server)
We are using CMS and developing with nuxt3.
I am developing with SSG, but the client does not want to display the path to the external API, so I have implemented a search implementation that usesFetch to get a list of the original data and then creates server/api/search.js in nuxt and calls this as the internal API to filter the data. The search is then performed by calling this internal API for filtering.
Now, here is the problem... when I generate npx, an error occurs and server/api/search.js is no longer available.
POST http://localhost:3000/api/search 404 (Not Found)Can't I use server/hogehoge in the SSG environment?
If not, I would appreciate it if you could give me an alternative.
(https://nuxt.com/docs/guide/directory-structure/server)
Nuxt
The server/ directory is used to register API and server handlers to your application.

