Merge branch 'develop' into dist/ubuntu/bionic/develop
This commit is contained in:
commit
9749ede28a
|
@ -2,6 +2,7 @@ package route
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.cadoles.com/Cadoles/daddy/internal/config"
|
"forge.cadoles.com/Cadoles/daddy/internal/config"
|
||||||
|
@ -62,6 +63,17 @@ func Mount(r *chi.Mux, config *config.Config) error {
|
||||||
r.Handle("/v1/graphql", gql)
|
r.Handle("/v1/graphql", gql)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
clientIndex := path.Join(config.HTTP.PublicDir, "index.html")
|
||||||
|
|
||||||
|
serveClientIndex := func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
http.ServeFile(w, r, clientIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of paths handled directly by the client
|
||||||
|
r.Get("/workgroups/*", serveClientIndex)
|
||||||
|
r.Get("/profile", serveClientIndex)
|
||||||
|
|
||||||
|
// Serve static files
|
||||||
notFoundHandler := r.NotFoundHandler()
|
notFoundHandler := r.NotFoundHandler()
|
||||||
r.Get("/*", static.Dir(config.HTTP.PublicDir, "", notFoundHandler))
|
r.Get("/*", static.Dir(config.HTTP.PublicDir, "", notFoundHandler))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue