MCPcopy Create free account
hub / github.com/krau/SaveAny-Bot / Start

Function Start

api/server.go:153–170  ·  view source on GitHub ↗

Start initializes and starts the API server. It refuses to start without a token, since an open download proxy is a security risk.

(ctx context.Context)

Source from the content-addressed store, hash-verified

151// Start initializes and starts the API server. It refuses to start without a
152// token, since an open download proxy is a security risk.
153func Start(ctx context.Context) error {
154 cfg := config.C().API
155
156 if !cfg.Enable {
157 return nil
158 }
159
160 if cfg.Token == "" {
161 return fmt.Errorf("API server is enabled but no token is set; refusing to start insecurely")
162 }
163
164 server := NewServer(ctx)
165 if err := server.Start(ctx); err != nil {
166 return err
167 }
168 StartCleanupLoop(ctx)
169 return nil
170}

Callers 1

initAllFunction · 0.92

Calls 4

StartMethod · 0.95
CFunction · 0.92
NewServerFunction · 0.85
StartCleanupLoopFunction · 0.85

Tested by

no test coverage detected