Bwf/ GuideFrançais
Bwf Guide

Build and deploy an application

We’ll build the server and put its public files beside it. Once the service is running, we can make a health request to check the deployment.

Decide what to ship

For a native deployment, copy the executable and the static/ directory to the host. The server will also need its runtime libraries and a database with the application’s schema. Set the database address on the host and configure the HTTPS proxy there.

IHP deployment guide

Build the native release

Build from the project root with scripts/bwf build. You should now have build/app. Check for the stylesheet as well. Ship the generated contents of static/ with the executable and start the service with that directory under its working directory.

Build the app and check that the stylesheet is present.

scripts/bwf build --target native
test -x build/app
test -f static/app.css

Set the database URL and public origin

Point DATABASE_URL at the release database before running the migrations. For a site served over HTTPS, enable secure cookies. If the site uses Auto Refresh, set BWF_PUBLIC_ORIGIN to the HTTPS origin a reader sees in the browser, and have your proxy forward WebSocket upgrades.

Supply the database connection through the host environment. Use the public address clients will actually visit.

BWF_PUBLIC_ORIGIN=https://journal.example.org ./build/app

Make three requests after deployment

Try the health endpoint, a database-backed page or API response, and a static file. A successful health probe can be independent of PostgreSQL. If the app uses accounts or live views, test login and the WebSocket through the public host too.

The three commands below check the running Journal.

curl -fsS http://127.0.0.1:18088/healthz
curl -fsS http://127.0.0.1:18088/
curl -fsSI http://127.0.0.1:18088/static/app.css

Export the public pages

List the public GET routes in static.bend. Each must return a complete HTML page with status 200 without signing in. The starter from bwf new already lists its home page.

From my-site, created during installation, run:

../bwf/scripts/bwf static --base-path /my-site

bwf static writes HTML, public files and .nojekyll to build/site/. For a GitHub Pages project site, pass the repository prefix as the base path. For a site at the domain root, omit it.

From the Bwf checkout root, ./scripts/bwf static --base-path /bwf exports the landing page and both languages of the guide. Search runs in the browser.

See the running Journal

Update the Journal in place