@@ -56,8 +61,8 @@
let answers = JSON.parse(body);
let result = "";
for (let i of answers)
- result += `
${i}`;
- document.getElementById("answers").innerHTML = result;
+ result += `
${i.Text}`;
+ document.getElementById("answers-list").innerHTML = result;
});
}
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 6532929..ed0aa3f 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -17,7 +17,6 @@ import (
"strings"
"syscall"
- "gitea.inhome.blapointe.com/local/gziphttp"
"golang.org/x/time/rate"
)
@@ -163,9 +162,6 @@ var public = func() http.FileSystem {
func (h Handler) handle(session Session, w http.ResponseWriter, r *http.Request) error {
if !strings.HasPrefix(r.URL.Path, "/api/") {
- if gziphttp.Can(r) {
- w = gziphttp.New(w)
- }
w.Header().Set("Cache-Control", "private, max-age=60")
http.FileServer(public).ServeHTTP(w, r)
return nil
@@ -268,7 +264,7 @@ func (db fsDB) GetQuestions() ([]Question, error) {
}
results := []Question{}
for _, entry := range entries {
- if strings.HasPrefix(path.Base(entry.Name()), ".") {
+ if strings.HasPrefix(path.Base(entry.Name()), ".") || entry.IsDir() {
continue
}
qid := path.Base(entry.Name())