Charles KWON OhJun 47b8f0434a feat(static): embed labdb/public/* and serve from BridgeDispatch
Drops labdb's index.html / login.html / css / js into the binary via
embed.FS so the single 24 MB fivenode_go binary now ships both the
HTML/JS frontend AND the JSON API. No web server, no Apache,
no asset bundler.

  hbrtl_ext/labdb_static/
    public/                 mirror of fivenode/labdb/public/
    assets.go               //go:embed public + two PRG-callable
                            HB_FUNCs: LABDB_STATIC_FILE(cPath) returns
                            the bytes, LABDB_STATIC_MIME(cPath)
                            returns the Content-Type derived from
                            the resolved (not raw) extension so "/"
                            -> text/html, not application/octet-stream.

  app/bridge_server.prg
    BridgeDispatch now falls through to the static FS for any path
    that isn't /api/*. Missing assets get a 404 instead of being
    routed to the path-to-symbol dispatcher.

Verified:
  GET /                  -> 200 text/html, full index.html body
  GET /login.html        -> 200 text/html, 1850 bytes
  GET /css/app.css       -> 200 text/css
  GET /api/admin-stats   -> 200 JSON {devices:2,...} (still live PG)
  GET /nonexistent.html  -> 404 text/plain

Phase 1a complete: HTTP serves both the labdb frontend and the
real-data labdb API from one binary, end to end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 17:01:09 +09:00

fivenode_go

FiveNode for Five — a Harbour-compatible web framework that compiles to a single Go binary. No Node.js, no FFI, no Apache. PRG sources go in, one executable comes out.

Successor to the koffi/N-API based fivenode framework, rebuilt on the Five Pure-Go runtime.

Status

Early bootstrap — Phase 1a in progress.

Architecture

Browser ──── HTTP/HTTPS ──── fivenode_go single binary
                              ├─ Five hbrt VM (PRG interpreter / compiled)
                              ├─ Five hbrtl (483 standard RTL functions)
                              ├─ hbrtl_ext/httpserver  — HTTP server RTL
                              ├─ hbrtl_ext/capi        — bridge_*.prg helpers
                              ├─ hbrtl_ext/pgrtl       — PostgreSQL client RTL
                              ├─ app/                  — bridge_*.prg + app PRG
                              └─ go:embed              — static assets

fnode build api/*.prg --extra-rtl=hbrtl_ext/... -o myapp produces a self-contained binary. No external dependencies beyond what the app code itself opens (e.g. a Postgres connection).

Build

go build -o fnode ./cmd/fnode
./fnode build app/hello.prg -o hello
./hello

License

Copyright (c) 2026 Charles KWON OhJun. All rights reserved.

Description
FiveNode for Five — Harbour PRG web framework as a single Go binary (no Node.js, no FFI)
Readme 139 KiB
Languages
xBase 44.2%
Go 35.8%
HTML 10.2%
CSS 8.1%
JavaScript 1.7%