Dev.to WebDev 🛠 Dev 👁 0 📖 8 min read

Shipping a Static Blog with a Small API: A Pre-Release Checklist

Shipping a Static Blog with a Small API: A Pre-Release Checklist A static blog feels simple until it has a small API behind it. Then a release is no longer “build and upload HTML.” It is a small system with two deploya

Shipping a Static Blog with a Small API: A Pre-Release Checklist

A static blog feels simple until it has a small API behind it. Then a release is no longer “build and upload HTML.” It is a small system with two deployable parts, a database, a set of environment variables, and a public surface that can reveal mistakes.

On wuhuajin.com, the front end is static, but membership applications, support records, and notifications run through a small API. Over several releases I turned the ad-hoc launch steps into a checklist. It is not a large CI/CD pipeline; it is a set of gates that catch the failures I actually hit.

This article walks through the checklist, with the reasoning behind each gate.

The failure modes

Most release problems on a small site fall into five buckets:

  1. Test data reaches production. A test application appears in a public support ledger, or a test account receives a real notification.
  2. A secret is committed. An environment file, a token, or a webhook URL ends up in the repository.
  3. The build is stale. The HTML on the server does not match the Markdown or the build script.
  4. The API and front end disagree. The front end expects a field the API no longer returns, or a route moved.
  5. Nobody can roll back. The release works, but the previous version is not recoverable.

The checklist is organized around those five.

Gate 1: Freeze and build from a clean checkout

Before building, stop editing the branch. A release built from a dirty working tree is not reproducible, and it makes rollback guesswork.

I use a simple sequence:

git status
git switch -c release/2026-11
npm run build

The build runs from the checked-out tree, not from a directory with local experiments. If the build needs generated assets, they are generated in the same step, not copied from a previous run.

The output is inspected before deployment:

  • the number of article HTML files;
  • the number of sitemap URLs;
  • the presence of the expected new pages;
  • the absence of test pages.

A count check is crude, but it catches the common failure where a build script silently skips a directory.

Gate 2: Secret hygiene

The rule is simple: the repository contains no live credentials, and the deployed API reads secrets from its runtime environment.

In practice:

  • the environment file is not tracked by Git;
  • the ignore rules cover local overrides and generated credentials;
  • the front-end build does not embed API secrets;
  • the API reads only the variables it needs, with a startup check that fails fast when a required value is missing.

A useful audit is to search the entire history, not just the working tree:

git log --all --full-history -- '*env*'
git grep -n 'api_key\|secret\|token\|password' $(git rev-list --all)

The search is noisy, but it surfaces old commits that may still contain a credential. If a live secret was ever committed, rotating it is the only reliable fix; deleting the file from the latest commit is not enough.

I also keep a short list of values that must never appear in public content:

  • server addresses;
  • private repository names;
  • internal subdomains;
  • absolute server paths;
  • credential file paths;
  • API tokens and webhook URLs.

This list is part of the content review, not just the code review. A technical article can leak an internal hostname as easily as a config file.

Gate 3: Test data review

Test data is the most underestimated release risk. It looks harmless in a local database and becomes public the moment the API is deployed.

The review has three steps:

  1. Identify test records. Query by known test names, test email patterns, and test amounts. Do not rely on memory.
  2. Decide the treatment. Delete, archive to a non-public table, or mark as test-only. The decision depends on whether the record is needed for a demo.
  3. Verify the public endpoint. A cleanup script that exits successfully is not proof. The public API must be queried after the release.

A sample query:

SELECT id, email, display_name, amount, method, note, created_at
FROM support_records
WHERE email LIKE '%test%'
   OR display_name IN ('测试', 'test')
   OR note LIKE '%测试%';

If the record is deleted, the public response should no longer include it. If the record is kept for internal testing, it must be excluded from the public projection, not merely hidden in the UI.

The same check applies to membership applications and notification outbox rows. A test application that still has a pending outbox event can send a real email after deployment.

Gate 4: Build verification

The build should fail loudly when a public-surface invariant is broken. I use a small verification script that runs after the main build.

It checks:

  • every expected article has an HTML output;
  • every HTML page has a title and a canonical URL;
  • pages marked noindex are not in the sitemap;
  • no page contains a test marker;
  • ad-related code appears only where the allowlist permits it;
  • the sitemap count is within the expected range;
  • the ads.txt file exists and contains the expected publisher ID.

A few of these are specific to this site, but the pattern generalizes: encode the invariants you care about, and run them on every build.

The verification script is not a replacement for human review. It is a tripwire. It catches the regression that would otherwise be found by a reader.

Gate 5: API smoke tests

Before deploying, I run a small set of API checks against a staging instance:

curl -sS http://127.0.0.1:8787/api/health
curl -sS http://127.0.0.1:8787/api/support/records?limit=5
curl -sS -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8787/api/admin/support/list

The expected results:

  • health returns OK;
  • the public records endpoint returns only public fields;
  • the admin endpoint returns 401 without authentication;
  • a malformed request returns 400, not 500;
  • rate-limited endpoints return 429 after the limit, not a silent drop.

The public-field check is the most important. A 200 response with an email address in it is a privacy bug, even if the UI never displays the field.

I also test one full application flow in staging:

  1. submit an application;
  2. verify the row and the outbox event;
  3. open the signed review link;
  4. approve;
  5. verify the membership record and the notification status.

This catches the integration failures that unit tests miss: a missing column, a stale template, a queue worker that is not running.

Gate 6: Deploy atomically

The API deployment should not overwrite files in place while the process is serving requests. A simple pattern:

  1. upload the new release to a versioned directory;
  2. run a health check against the new version on a temporary port;
  3. switch the service to the new directory;
  4. restart the process;
  5. keep the previous release directory for rollback.

For the static front end, the same idea applies: upload to a staging directory, then switch the active path. If the site is served directly from a Git checkout, at least ensure the build completes before the checkout is updated.

The database is the part that cannot be swapped as easily. For a SQLite-backed API:

  • take a consistent backup before a schema change;
  • run migrations in a transaction where possible;
  • keep a migration log;
  • test the rollback path on a copy.

A backup is not a substitute for a migration plan, but it is the last line of defense.

Gate 7: Post-deploy verification

After deployment, check the public surface from the outside:

curl -I https://wuhuajin.com/
curl -I https://wuhuajin.com/ads.txt
curl -sS https://wuhuajin.com/api/support/records?limit=5

Then open the key pages in a browser:

  • the home page;
  • a normal article;
  • a member-only article;
  • the subscription page;
  • the support ledger;
  • a 404 page.

Look for:

  • broken layout;
  • missing images;
  • a public API response with a private field;
  • a test record that survived cleanup;
  • an ad or script that appears on a page where it should not;
  • a notification that was sent for a test event.

The post-deploy check is also the moment to confirm that the old release is still available for rollback.

What I changed after the first release

The first release was mostly manual. The changes that mattered:

  1. The environment file is no longer tracked. It is generated on the server and read at runtime.
  2. Test data has an explicit review query. The release is not considered complete until the public endpoint is checked.
  3. The build has a verification step. Counting pages and checking noindex/sitemap consistency catches the silent regressions.
  4. The API has a health endpoint and a public-field test. The admin route is checked for 401, not just “it works when logged in.”
  5. The previous release is kept. Rollback is a directory switch, not a rebuild under pressure.

None of these are sophisticated. They are the minimum for a release that can be repeated without relying on memory.

The checklist

For a small static site with an API, the release checklist is:

  • [ ] clean checkout and reproducible build;
  • [ ] no live secrets in the repository or history;
  • [ ] test records identified, treated, and verified through the public API;
  • [ ] build verification: page count, sitemap, noindex, allowlists;
  • [ ] API smoke tests: health, public fields, auth, validation, rate limits;
  • [ ] one end-to-end application flow in staging;
  • [ ] atomic deploy with a rollback directory;
  • [ ] database backup and migration log;
  • [ ] post-deploy public checks;
  • [ ] previous release retained.

The order matters: secrets and test data before deployment, public verification after.

The lesson

A static site plus a small API is still a system. The release process should treat it like one, even if the system is small.

The most valuable gates are not the ones that catch syntax errors. They are the ones that catch state leakage: a test row in a public ledger, a secret in an old commit, a noindex page in the sitemap, or a notification sent for an event that was supposed to be deleted.

Those failures are quiet. A checklist makes them loud.

This article describes the release process for wuhuajin.com, a static blog with a small membership and notification API. The checklist focuses on secret hygiene, test-data verification, build invariants, and rollback.

Originally published on wuhuajin.com.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.