Katschukkanskadinio
Generating routes from Nitro API call
Hey all,
it may be a dumb question, since I did not find someone else asking the same question before, but …
… I have a nitro api route that fetches data and returns a couple of objects, one of which is a string array called "slugs". I want to use that array for "npm run generate" within my "nitro: { hooks: { async "prerender:routes"(routes) {" function.
Is it possible to make a post request to this "/api/cmsdata" endpoint during the generation process to define all possible routes? Or is there a smarter way?
Cheers! 🙏🏻
1 replies