Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps a BrainGraph and serves the REST API and frontend.
func NewServer ¶
func NewServer(g *graph.BrainGraph, opts ServerOptions) *Server
NewServer creates a new API server with the given graph.
type ServerOptions ¶
type ServerOptions struct {
// AllowOrigin, when non-empty, is sent as the Access-Control-Allow-Origin
// header on /api responses. Empty disables CORS entirely — appropriate
// for the default localhost-only bind.
AllowOrigin string
}
ServerOptions configures optional behavior of the API server.
Click to show internal directories.
Click to hide internal directories.