Host on other platforms

Upload your exported Bevel site to Netlify, Cloudflare Pages, Azure Static Web Apps, S3, nginx, or run the ASP.NET Core app itself.

On this page

Every static host needs the same three facts from you:

  1. The output folder. Upload what --bevel-build wrote (for example dist).
  2. The base path. Set BevelOptions.PathBase only if the site is not at the domain root.
  3. A 404 page. Map /404.html and tell the host to serve it for unknown URLs.
bash
dotnet run -c Release -- --bevel-build dist

On a static host, Bevel does not run. The host serves the files as they are, so set up 404 pages, fallbacks and redirects in the host's settings.

Pick your host

  • Build command: dotnet run -c Release -- --bevel-build dist
  • Publish directory: dist
  • Netlify serves a root 404.html for unknown URLs by default.
  • Keep the path base empty unless you serve from a sub-path.

Choose an output style that matches the host

DirectoryIndex (default) writes about/index.html, and links look like /about. Most hosts serve that. If a host expects .html files, use FlatHtml (about.html, links like /about.html). See Choose an output style.

Host the ASP.NET Core app itself

Run the app instead of uploading files when the site lives next to live endpoints such as APIs or sign-in pages. Export first, then publish with the exported wwwroot:

bash
dotnet run -c Release -- --bevel-build
dotnet publish -c Release

Or set <BevelExportOnPublish>true</BevelExportOnPublish> and run only dotnet publish. Run the published app as is.

  • Run it in a non-Development environment. Bevel then serves the exported files, verified against .bevel-output.json.
  • Set PathBase and call app.UsePathBase(...) if the app sits under a sub-path behind a reverse proxy.
  • Map /404.html and call app.UseStatusCodePagesWithReExecute("/404.html") for a custom 404 page. Status-code pages keep the original status.
  • Routes that need authorization are not exported unless you allow it, so they render live. See Authorization and exports.

How the app answers requests is covered in Development and production.