2017-08-20 03:52:42 +05:30
|
|
|
package http
|
2017-06-30 21:10:25 +05:30
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2018-02-11 19:27:20 +05:30
|
|
|
func (cfg *Config) NotFound(response http.ResponseWriter, request *http.Request) {
|
2017-08-20 03:52:42 +05:30
|
|
|
data, _ := json.Marshal(map[string]string{
|
2018-02-11 19:27:20 +05:30
|
|
|
"status": "404",
|
2017-06-30 21:10:25 +05:30
|
|
|
"message": "Not Found",
|
|
|
|
})
|
|
|
|
|
|
|
|
response.Header().Set("Content-Type", "application/json")
|
|
|
|
response.WriteHeader(http.StatusNotFound)
|
2017-08-20 03:52:42 +05:30
|
|
|
response.Write(data)
|
2017-06-30 21:10:25 +05:30
|
|
|
}
|