mirror of
https://github.com/elyby/chrly.git
synced 2024-12-23 13:40:11 +05:30
18 lines
359 B
Go
18 lines
359 B
Go
package http
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
func (cfg *Config) NotFound(response http.ResponseWriter, request *http.Request) {
|
|
data, _ := json.Marshal(map[string]string{
|
|
"status": "404",
|
|
"message": "Not Found",
|
|
})
|
|
|
|
response.Header().Set("Content-Type", "application/json")
|
|
response.WriteHeader(http.StatusNotFound)
|
|
response.Write(data)
|
|
}
|