|
|
@@ -18,9 +18,17 @@ func NewServer(filename string) *Server {
|
|
|
|
|
|
}
|
|
|
|
|
|
+func Ceva(s *Server) http.HandlerFunc {
|
|
|
+ return func(w http.ResponseWriter, r *http.Request) {
|
|
|
+ //s.Err = fmt.Errorf("bla")
|
|
|
+ s_json := inout.ObjToJson(s)
|
|
|
+ w.Write([]byte(s_json))
|
|
|
+ }
|
|
|
+}
|
|
|
func (s *Server) Run() {
|
|
|
// adding endpoints to the server
|
|
|
http.HandleFunc("/", Wildcard)
|
|
|
+ http.Handle("/ceva", Ceva(s))
|
|
|
|
|
|
//running server
|
|
|
fmt.Printf("Server running at http://%s:%s/\n", s.Host, s.Port)
|