2017-08-20 01:22:42 +03:00
|
|
|
package http
|
2017-06-30 18:40:25 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2018-02-11 16:57:20 +03:00
|
|
|
func (cfg *Config) NotFound(response http.ResponseWriter, request *http.Request) {
|
2017-08-20 01:22:42 +03:00
|
|
|
data, _ := json.Marshal(map[string]string{
|
2018-02-11 16:57:20 +03:00
|
|
|
"status": "404",
|
2017-06-30 18:40:25 +03:00
|
|
|
"message": "Not Found",
|
2018-02-16 18:48:55 +03:00
|
|
|
"link": "http://docs.ely.by/skin-system.html",
|
2017-06-30 18:40:25 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
response.Header().Set("Content-Type", "application/json")
|
|
|
|
response.WriteHeader(http.StatusNotFound)
|
2017-08-20 01:22:42 +03:00
|
|
|
response.Write(data)
|
2017-06-30 18:40:25 +03:00
|
|
|
}
|