Fixed base path (again again again) and rewrote .env
This commit is contained in:
6
main.go
6
main.go
@@ -17,8 +17,8 @@ func main() {
|
||||
r.StrictSlash(true)
|
||||
|
||||
var subrouter *mux.Router
|
||||
if config.Prefix != "" {
|
||||
subrouter = r.PathPrefix(config.Prefix).Subrouter()
|
||||
if config.Path != "/" {
|
||||
subrouter = r.PathPrefix(config.Path).Subrouter()
|
||||
} else {
|
||||
subrouter = r
|
||||
}
|
||||
@@ -69,7 +69,7 @@ func setupFrontend(r *mux.Router) {
|
||||
r.Path("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
landingpage.Execute(w, struct {
|
||||
BasePath string
|
||||
}{BasePath: config.BasePath})
|
||||
}{BasePath: config.Address + config.Path})
|
||||
})
|
||||
|
||||
r.NotFoundHandler = http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user