Skip to content

Commit

Permalink
Merge pull request #100 from mbaraa/dev
Browse files Browse the repository at this point in the history
goodbye release
  • Loading branch information
mbaraa authored Jul 10, 2024
2 parents 4e02e7f + 12c3038 commit d2f4441
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ func StartServer(staticFS embed.FS) error {
m.AddFuncRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma)script$"), js.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), json.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]xml$"), xml.Minify)
pagesHandler.Handle("/static/", m.Middleware(http.FileServer(http.FS(staticFS))))
if config.Env().GoEnv == "dev" || config.Env().GoEnv == "beta" {
pagesHandler.Handle("/static/", http.FileServer(http.FS(staticFS)))
} else {
pagesHandler.Handle("/static/", m.Middleware(http.FileServer(http.FS(staticFS))))
}
pagesHandler.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
robotsFile, _ := staticFS.ReadFile("static/robots.txt")
w.Header().Set("Content-Type", "text/plain")
Expand Down Expand Up @@ -127,7 +131,7 @@ func StartServer(staticFS embed.FS) error {

log.Info("Starting http server at port " + config.Env().Port)
if config.Env().GoEnv == "dev" || config.Env().GoEnv == "beta" {
return http.ListenAndServe(":"+config.Env().Port, logger.Handler(ismobile.Handler(theme.Handler(m.Middleware(applicationHandler)))))
return http.ListenAndServe(":"+config.Env().Port, logger.Handler(ismobile.Handler(theme.Handler(applicationHandler))))
}
return http.ListenAndServe(":"+config.Env().Port, ismobile.Handler(theme.Handler(m.Middleware(applicationHandler))))
}

0 comments on commit d2f4441

Please sign in to comment.