MCPcopy
hub / github.com/httprunner/httprunner / Index

Method Index

hrp/server.go:161–168  ·  view source on GitHub ↗

Index renders an HTML index page

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

159
160// Index renders an HTML index page
161func (api *apiHandler) Index(w http.ResponseWriter, r *http.Request) {
162 if r.URL.Path != "/" {
163 http.Error(w, "Not Found", http.StatusNotFound)
164 return
165 }
166 w.Header().Set("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' www.httprunner.com")
167 fmt.Fprintf(w, "Welcome to httprunner page!")
168}
169
170func (api *apiHandler) Start(w http.ResponseWriter, r *http.Request) {
171 var resp *CommonResponseBody

Callers 5

ParseMethod · 0.45
ParseStringMethod · 0.45
extractVariablesFunction · 0.45
findallVariablesFunction · 0.45
convertParametersFunction · 0.45

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected