server

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware(allowedOriginsCSV string, next http.Handler) http.Handler

CORSMiddleware restricts browser cross-origin access to the API. allowedOriginsCSV is a comma-separated list of exact origins (e.g. https://app.example.com,http://localhost:5173). If empty, the handler is returned unchanged (no CORS headers — same-origin / non-browser clients only).

func MountAPI

func MountAPI(mux *http.ServeMux, store storage.Provider, j *auth.JWT, graphSvc *graph.Service, vaultRoot string, assets blob.Provider)

MountAPI registers SaaS REST routes on mux. Public: /api/v1/health, /api/v1/auth/token. All other /api/v1/* routes require Authorization: Bearer <JWT>. If graphSvc is non-nil, POST /api/v1/pages/reindex is registered (markdown → index). vaultRoot is the indexed notes directory (absolute). When empty, capture and graph return 503. assets may use filesystem under vaultRoot or S3/MinIO via blobProv when non-nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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