diff options
| author | herkulessi <git@herkulessi.de> | 2026-06-22 21:49:43 +0200 |
|---|---|---|
| committer | herkulessi <git@herkulessi.de> | 2026-06-22 21:49:43 +0200 |
| commit | 3a635fc9dd92e91ce731abe815cde966a0e38553 (patch) | |
| tree | f36e4d79685b50add5f407c48d5ba3d968de7529 /main.go | |
| parent | 9406e21b1e728c1e99b4edcdf1b5e02c76a1ffe7 (diff) | |
Make IsDynamic public
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -70,7 +70,7 @@ func (w *Webpage) HandlerStatic(pattern string, handler http.Handler) *Webpage { // Returns the proper Mux for the current Request based on the request type without the magic internal mux func (w *Webpage) getHandler() http.Handler { - if w.isDynamic() { + if w.IsDynamic() { return w.muxDynamic } else { return w.muxStatic @@ -82,15 +82,15 @@ func (w *Webpage) GetHandler() http.Handler { return handler{w} } -func (w *Webpage) isDynamic() bool { +func (w *Webpage) IsDynamic() bool { return os.Getenv("PATH_INFO") == "" } func (w *Webpage) isStatic() bool { - return !w.isDynamic() + return !w.IsDynamic() } func (w *Webpage) Serve() { - if w.isDynamic() { + if w.IsDynamic() { fmt.Println("Listening on [::]:8080") panic(http.ListenAndServe(":8080", w.GetHandler())) } |
