MCPcopy Create free account
hub / github.com/devfeel/dotweb / ServerFile

Method ServerFile

server.go:352–354  ·  view source on GitHub ↗

ServerFile a shortcut for router.ServeFiles(path, fileRoot) simple demo:server.ServerFile("/src/*filepath", "/var/www")

(path string, fileRoot string)

Source from the content-addressed store, hash-verified

350// ServerFile a shortcut for router.ServeFiles(path, fileRoot)
351// simple demo:server.ServerFile("/src/*filepath", "/var/www")
352func (server *HttpServer) ServerFile(path string, fileRoot string) RouterNode {
353 return server.Router().ServerFile(path, fileRoot)
354}
355
356// RegisterHandlerFunc a shortcut for router.RegisterHandlerFunc(routeMethod string, path string, handler http.HandlerFunc)
357func (server *HttpServer) RegisterHandlerFunc(routeMethod string, path string, handler http.HandlerFunc) RouterNode {

Callers

nothing calls this directly

Calls 2

RouterMethod · 0.95
ServerFileMethod · 0.65

Tested by

no test coverage detected