dashboard: some improvements
This commit is contained in:
parent
8190bbfdc0
commit
196f10dc9f
5 changed files with 43 additions and 4 deletions
|
@ -4,9 +4,11 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"srs.epita.fr/fic-server/dashboard/api"
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
"srs.epita.fr/fic-server/settings"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
@ -33,6 +35,10 @@ func init() {
|
|||
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
||||
})
|
||||
|
||||
api.Router().GET("/files/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(fic.FilesDir, strings.TrimPrefix(r.URL.Path, "/files")))
|
||||
})
|
||||
|
||||
api.Router().GET("/events.json", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
http.ServeFile(w, r, path.Join(TeamsDir, "events.json"))
|
||||
|
|
Reference in a new issue