How-to
Website
Web app
Deploy to Netlify
This recipe has Netlify build a WebFluent site on every push and serve it, with the security headers the build writes. You need a Netlify account and the project in a repository Netlify can read; the build command installs wf as Install wf on a build machine shows. Add netlify.toml at the project's root:
[build]
command = "curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/monzeromer-lab/WebFluent/master/install.sh | WF_VERSION=v7.1.1 bash && ~/.webfluent/bin/wf build"
publish = "build"
For a single-page build, also add public/_redirects with this line:
/* /index.html 200
How it works
Then connect the repository in Netlify, or push to the branch it deploys.
commandinstallswfand builds the site;publishtells Netlify to serve thebuild/folder.- The build copies
public/_redirectsto the root ofbuild/. Its line answers every path withindex.htmland a200, so a reload on/users/42reaches the single-page build's router. - Netlify reads
_headersfrom the build, so the security headers apply with no further setting (Set cache and security headers).
Check it
In the browser's network panel, select the page's document request. Its response headers include Content-Security-Policy and X-Content-Type-Options: nosniff, which came from _headers. Then go through Check a deploy.