[Question] Generating static sites on-demand with Nuxt.js
[issue link]Hi, I’m trying to create a static-site on-demand API using hapi.js to power the API & nuxt.js as the static-site generator but hitting some blockers….
Here’s my setup:
- The API takes a POST payload
- Based on the payload the API dynamically creates the
generate.routesarray (passing payloads in for each route) - Calls
generate()to create the static site in./dist
Issue:
This API is potentially going to be hammered - building a lot of individual content pages and pushing them to S3 buckets. All generated sites going to the ./dist directory is a problem - I currently have an isGenerating flag to prevent multiple generate calls, forcing the client to re-try the API.
- Is using Nuxt as a static-site generator on-demand a ridiculous idea?
- If (hopefully) not, are there ways of managing the output better. Potentially streaming straight to an S3 bucket?
- Should the generator be able to handle parallel builds?
Thanks in advance,
James