MCPcopy
hub / github.com/cortesi/devd / ServeScript

Method ServeScript

livereload/livereload.go:131–138  ·  view source on GitHub ↗

ServeScript is a handler function that serves the livereload JavaScript file

(rw http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

129
130// ServeScript is a handler function that serves the livereload JavaScript file
131func (s *Server) ServeScript(rw http.ResponseWriter, req *http.Request) {
132 rw.Header().Set("Content-Type", "application/javascript")
133 clientBox := rice.MustFindBox("static")
134 _, err := rw.Write(clientBox.MustBytes("client.js"))
135 if err != nil {
136 s.logger.Warn("Error serving livereload script: %s", err)
137 }
138}

Callers

nothing calls this directly

Calls 2

HeaderMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected