The static HTML generator will essentially use the rendering engine and the http transport to save all the rendered HTML for all the given routes, to the file system, as static HTML pages.
Note that this plugin works by performing a GET request to the alias of all registered actions and saving the result HTML into the static folder, using the given alias as the file path. This entire documentation is made with this plugin, so you can check it out.
# install the plugin npm i --save thorin-plugin-static-html@1.x
'use strict'; // app.js entry file const thorin = require('thorin'); thorin.addPlugin(require('thorin-plugin-static-html')); // <-- add this line thorin.run((err) => {});
# run once to allow the plugin to set itself up node app.js --setup=plugin.static-html
public/
in order to ship your entire public/ folder as the static page.
generate()
function
sitemap.xml
file. You do not have to override this, as it defaults to the internal one.
sitemap
to false will avoid generating the sitemap.xml
file
/my/action/right/here
converts to thorin.root + /public/static/my/action/right/here.html
You can always create a new issue on GitHub or contact one of the core founders by chat.