diff options
-rw-r--r-- | system/admin/handlers.go | 40 | ||||
-rw-r--r-- | system/admin/server.go | 2 |
2 files changed, 0 insertions, 42 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index a4eda03..2be8d8e 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -588,43 +588,3 @@ func searchHandler(res http.ResponseWriter, req *http.Request) { res.Header().Set("Content-Type", "text/html") res.Write(adminView) } - -// func staticAssetHandler(res http.ResponseWriter, req *http.Request) { -// path := req.URL.Path -// pathParts := strings.Split(path, "/")[1:] -// pwd, err := os.Getwd() -// if err != nil { -// log.Fatal("Coudln't get current directory to set static asset source.") -// } - -// var filePathParts = []string{} -// filePathParts = append(filePathParts, pwd) -// filePathParts = append(filePathParts, "cmd") -// filePathParts = append(filePathParts, "ponzu") -// filePathParts = append(filePathParts, "vendor") -// filePathParts = append(filePathParts, "github.com") -// filePathParts = append(filePathParts, "bosssauce") -// filePathParts = append(filePathParts, "ponzu") -// filePathParts = append(filePathParts, "system") -// filePathParts = append(filePathParts, pathParts...) - -// fmt.Println(filepath.Join(filePathParts...)) - -// http.ServeFile(res, req, filepath.Join(filePathParts...)) -// } - -// func staticUploadHandler(res http.ResponseWriter, req *http.Request) { -// path := req.URL.Path -// pathParts := strings.Split(path, "/")[2:] - -// pwd, err := os.Getwd() -// if err != nil { -// log.Fatal("Coudln't get current directory to set static asset source.") -// } - -// filePathParts := make([]string, len(pathParts)+1, len(pathParts)+1) -// filePathParts = append(filePathParts, pwd) -// filePathParts = append(filePathParts, pathParts...) - -// http.ServeFile(res, req, filepath.Join(filePathParts...)) -// } diff --git a/system/admin/server.go b/system/admin/server.go index d9637b1..6f4a96e 100644 --- a/system/admin/server.go +++ b/system/admin/server.go @@ -1,7 +1,6 @@ package admin import ( - "fmt" "log" "net/http" "os" @@ -35,7 +34,6 @@ func Run() { staticDir := filepath.Join(pwd, "cmd", "ponzu", "vendor", "github.com", "bosssauce", "ponzu", "system") http.Handle("/admin/static/", CacheControl(http.FileServer(http.Dir(staticDir)))) - fmt.Println(staticDir) // API path needs to be registered within server package so that it is handled // even if the API server is not running. Otherwise, images/files uploaded |