first commit. working templating, path routing, api responses, web menagment path
This commit is contained in:
31
web/manager/manager.go
Normal file
31
web/manager/manager.go
Normal file
@ -0,0 +1,31 @@
|
||||
package manager
|
||||
|
||||
// package for the web menagment of the api paths
|
||||
|
||||
import (
|
||||
"api_manager/web/api"
|
||||
"api_manager/web/render"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func Add_api(w http.ResponseWriter, req *http.Request) {
|
||||
// api.Apis["second"] = "/api/sec"
|
||||
fmt.Fprintf(w, "good")
|
||||
}
|
||||
|
||||
func Show_apis(w http.ResponseWriter, req *http.Request) {
|
||||
apis := api.Apis()
|
||||
eval := "<div>"
|
||||
for tag, varr := range apis {
|
||||
eval_group := ""
|
||||
eval_group += fmt.Sprintf("%v", varr)
|
||||
eval_group += "-"
|
||||
eval_group += tag
|
||||
eval_group += "<br>"
|
||||
eval += render.Template_of_tag(eval_group, "text")
|
||||
}
|
||||
eval += "</div>"
|
||||
|
||||
fmt.Fprint(w, render.Template_with_string(eval))
|
||||
}
|
||||
Reference in New Issue
Block a user