changed lib removed map_args, project_dir debug; changed render added get_template; small changes to api,manager due to function delition; big change to web split listen and serve for server log and routing through switch-case
This commit is contained in:
@ -23,7 +23,7 @@ func Get_api(w http.ResponseWriter, req *http.Request) {
|
||||
str := strings.Replace(string(req.RequestURI), "/api/", "", 1)
|
||||
|
||||
jData, err := json.Marshal(apis[str])
|
||||
lib.Handle_err(err, lib.Map_args())
|
||||
lib.Handle_err(err, map[string]string{})
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write(jData)
|
||||
@ -32,7 +32,7 @@ func Get_api(w http.ResponseWriter, req *http.Request) {
|
||||
// reding the api storage file. returning map value like map[main:{sub:sub}]
|
||||
func get_apis() map[string]interface{} {
|
||||
jsonFile, err := os.Open("web/api/apis")
|
||||
lib.Handle_err(err, lib.Map_args())
|
||||
lib.Handle_err(err, map[string]string{})
|
||||
|
||||
defer jsonFile.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user