embed

command
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 9 Imported by: 0

README

Embedded frontend example

Minimal framework.App with framework.WithEmbeddedFrontend over a tiny go:embed FS (index.html + assets/app.js) and a Huma API route.

Split deploy stays the default (C5). This example is the opt-in embed serve path used by gombit build --embed. See docs/build.md.

Run

go run ./examples/embed

curl

GET /, /login, and /assets/app.js hit the embed FS (SPA fallback for missing frontend routes). GET /api/v1/ping is the Huma API — not index.html. /readyz stays the probe.

# SPA index
curl -sS http://127.0.0.1:8080/
curl -sS http://127.0.0.1:8080/login

# static asset
curl -sS http://127.0.0.1:8080/assets/app.js

# API (JSON, D10 envelope)
curl -sS http://127.0.0.1:8080/api/v1/ping

# probe
curl -sS http://127.0.0.1:8080/readyz

# unmatched POST is not index.html
curl -sS -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:8080/login

Interactive docs: http://127.0.0.1:8080/docs.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL