mirror of
https://github.com/SourceFellows/gobuch.git
synced 2024-10-22 22:05:35 +00:00
23 lines
449 B
Go
23 lines
449 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/moogar0880/problems"
|
||
|
)
|
||
|
|
||
|
func handleHttp(res http.ResponseWriter, req *http.Request) {
|
||
|
NotFound := problems.NewStatusProblem(http.StatusNotFound)
|
||
|
bites, _ := json.Marshal(NotFound)
|
||
|
res.WriteHeader(http.StatusNotFound)
|
||
|
res.Header().Add("Content-Type", "application/json")
|
||
|
res.Write(bites)
|
||
|
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
http.HandleFunc("/a/", handleHttp)
|
||
|
http.ListenAndServe(":8080", nil)
|
||
|
}
|