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:
2025-10-13 20:38:21 +00:00
parent 3820bc399b
commit 960d9e2ff8
6 changed files with 86 additions and 43 deletions

View File

@ -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()