embed

command
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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