MCPcopy
hub / github.com/caddyserver/caddy / parseCaddyfile

Function parseCaddyfile

modules/caddyhttp/fileserver/caddyfile.go:38–49  ·  view source on GitHub ↗

parseCaddyfile parses the file_server directive. See UnmarshalCaddyfile for the syntax.

(h httpcaddyfile.Helper)

Source from the content-addressed store, hash-verified

36// parseCaddyfile parses the file_server directive.
37// See UnmarshalCaddyfile for the syntax.
38func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) {
39 fsrv := new(FileServer)
40 err := fsrv.UnmarshalCaddyfile(h.Dispenser)
41 if err != nil {
42 return fsrv, err
43 }
44 err = fsrv.FinalizeUnmarshalCaddyfile(h)
45 if err != nil {
46 return nil, err
47 }
48 return fsrv, err
49}
50
51// UnmarshalCaddyfile parses the file_server directive. It enables
52// the static file server and configures it with this syntax:

Callers

nothing calls this directly

Calls 2

UnmarshalCaddyfileMethod · 0.65

Tested by

no test coverage detected