Index renders an HTML index page
(w http.ResponseWriter, r *http.Request)
| 159 | |
| 160 | // Index renders an HTML index page |
| 161 | func (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 | |
| 170 | func (api *apiHandler) Start(w http.ResponseWriter, r *http.Request) { |
| 171 | var resp *CommonResponseBody |
no test coverage detected