diff --git a/web/pages/about.go b/web/pages/about.go new file mode 100644 index 0000000..67391c0 --- /dev/null +++ b/web/pages/about.go @@ -0,0 +1,7 @@ +package page + +import "net/http" + +func AboutHandler(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "web/src/about.html") +} diff --git a/web/pages/index.go b/web/pages/index.go new file mode 100644 index 0000000..de2e3b6 --- /dev/null +++ b/web/pages/index.go @@ -0,0 +1,22 @@ +package page + +import ( + "net/http" + + "github.com/Redume/EveryNasa/functions" +) + +func GalleryHandler(w http.ResponseWriter, r *http.Request) { + con := functions.Connected() + if con == false { + http.ServeFile(w, r, "web/src/errors/504.html") + return + } + + if r.URL.Path != "/" { + http.ServeFile(w, r, "web/src/errors/404.html") + return + } + + http.ServeFile(w, r, "web/src/gallery.html") +} diff --git a/web/pages/settings.go b/web/pages/settings.go new file mode 100644 index 0000000..987368c --- /dev/null +++ b/web/pages/settings.go @@ -0,0 +1,7 @@ +package page + +import "net/http" + +func SettingsHandler(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "web/src/settings.html") +}