bff

package
v0.0.1-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package bff implements the browser-facing API layer (BFF) for the Overcast web console. It exposes a single http.Handler that serves:

  • GET /api/* — thin proxies / adapters that call the emulator's internal endpoints and return JSON the SPA expects
  • /* — SPA static files with index.html fallback for client-side routing

The BFF is a like-for-like Go port of web/api/src/ (Hono/Node). Every endpoint preserves the same method, path, request headers, response shape, and streaming behaviour as the Node original.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(staticFS, docsFS fs.FS, cfg UIConfig) http.Handler

NewHandler returns an http.Handler that mounts all BFF routes under /api/ and serves the embedded SPA for everything else.

staticFS must be rooted at the dist directory (files accessible as "index.html", "assets/...", etc.). docsFS must be rooted at the published docs directory (files accessible as "services/s3.md", "cdk/local-vpc.md", etc.).

cfg is injected into every served index.html so the SPA can reach the API without user configuration. Pass a zero value from dev/test callers that don't embed the UI.

Types

type UIConfig

type UIConfig struct {
	// APIPort is the port the emulator API is listening on (default 4566).
	APIPort int
	// Region is the default AWS region the emulator advertises.
	Region string
	// Debug indicates whether OVERCAST_DEBUG is enabled for the emulator.
	Debug bool
}

UIConfig is injected into the served index.html so the bundled SPA knows where to reach the emulator API without any client-side guessing.

Jump to

Keyboard shortcuts

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