+/*
+func handleApp(w http.ResponseWriter, r *http.Request) {
+ fmt.Println("handleApp():", r.URL.Path)
+
+ // Security check: prevent walking up the directory
+ pos := strings.Index(r.Url.Path, "../")
+ if (-1) == pos {
+ fmt.Fprintln(w, "Paths containing \"../\" are not permitted:", r.URL.Path)
+ return
+ }
+
+ fileName := "../app" + r.URL.Path
+ _, err := os.Stat(fileName)
+ if nil != err {
+ fmt.Fprintln(w, "Failed to find file:", fileName, err)
+ return
+ }
+
+ http.ServeFile(w, r, "../app/" + r.URL.Path[1:])
+}
+*/
+