fix(web): PWA asset and route handling (#898)

* fix(web): PWA asset and fallback route handling

* fix(web): strip baseurl

* fix(web): add back manifest.json

* fix(web): add back manifest.json

* fix(web): log file

* fix(web): do not trim baseurl

* fix(web): try different start_url

* fix(web): pwa with subfolder
This commit is contained in:
ze0s 2023-05-02 19:06:53 +02:00 committed by GitHub
parent d085d894d4
commit 319bc2f200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 110 additions and 30 deletions

View file

@ -108,7 +108,6 @@ func (s Server) Handler() http.Handler {
r.Use(c.Handler)
encoder := encoder{}
web.RegisterHandler(r)
r.Route("/api", func(r chi.Router) {
r.Route("/auth", newAuthHandler(encoder, s.log, s.config.Config, s.cookieStore, s.authService).Routes)
@ -145,9 +144,8 @@ func (s Server) Handler() http.Handler {
})
})
// serve the parsed index.html
r.Get("/", s.index)
r.Get("/*", s.index)
// serve the web
web.RegisterHandler(r, s.version, s.config.Config.BaseURL)
return r
}