server

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package server provides the HTTP API server for defSource. It exposes endpoints for library search, documentation query, entity listing, and health checks. All handlers are wired through the withMiddleware chain defined in middleware.go.

Package server provides the HTTP API server for defSource. Use New to construct an *http.Server wired to a defSource client, then start it with ListenAndServe. The server applies the withMiddleware chain (logging, CORS, security headers, panic recovery) to all routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client *defsource.Client, addr string, corsOrigin string) *http.Server

New creates an HTTP server wired to the defSource client. corsOrigin is used verbatim as the Access-Control-Allow-Origin response header. All routes are wrapped with the full middleware chain: logging (outermost), CORS, security headers, and panic recovery (innermost). See middleware.go for the complete execution-order description.

Types

This section is empty.

Jump to

Keyboard shortcuts

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