Static GitHub Issues

[2370] [Question] Generating static sites on-demand with Nuxt.js

prev: Nuxt build hangs
next: [Question] Nuxt Commands

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:

  1. The API takes a POST payload
  2. Based on the payload the API dynamically creates the generate.routes array (passing payloads in for each route)
  3. 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. 1. Is using Nuxt as a static-site generator on-demand a ridiculous idea? 2. If (hopefully) not, are there ways of managing the output better. Potentially streaming straight to an S3 bucket? 3. Should the generator be able to handle parallel builds?

Thanks in advance, James

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2062">#c2062</a>)</em></sub></div>