From c09c3d78862e22d36dc68bc4e41b248b6820638b Mon Sep 17 00:00:00 2001 From: Redume Date: Sun, 23 Oct 2022 15:27:09 +0300 Subject: [PATCH] rewritten from net/http to fiber, changed port from 8080, 4662 to one 3000 --- web/pages/about.go | 28 ---------------------------- web/pages/index.go | 29 ----------------------------- web/pages/settings.go | 28 ---------------------------- 3 files changed, 85 deletions(-) delete mode 100644 web/pages/about.go delete mode 100644 web/pages/index.go delete mode 100644 web/pages/settings.go diff --git a/web/pages/about.go b/web/pages/about.go deleted file mode 100644 index bba81e7..0000000 --- a/web/pages/about.go +++ /dev/null @@ -1,28 +0,0 @@ -package page - -import ( - "github.com/Redume/EveryNasa/functions" - "net/http" - "strings" -) - -func AboutHandler(w http.ResponseWriter, r *http.Request) { - con := functions.Connected() - if con == false { - http.ServeFile(w, r, "web/src/errors/504.html") - return - } - - userAgent := r.UserAgent() - if strings.Contains(userAgent, "Mobile") { - http.ServeFile(w, r, "web/src/errors/mobile.html") - return - } - - if r.URL.Path != "/about" { - http.ServeFile(w, r, "web/src/errors/404.html") - return - } - - http.ServeFile(w, r, "web/src/about.html") -} diff --git a/web/pages/index.go b/web/pages/index.go deleted file mode 100644 index 79af089..0000000 --- a/web/pages/index.go +++ /dev/null @@ -1,29 +0,0 @@ -package page - -import ( - "github.com/Redume/EveryNasa/functions" - "net/http" - "strings" -) - -func GalleryHandler(w http.ResponseWriter, r *http.Request) { - con := functions.Connected() - if con == false { - http.ServeFile(w, r, "web/src/errors/504.html") - return - } - - userAgent := r.UserAgent() - - if strings.Contains(userAgent, "Mobile") { - http.ServeFile(w, r, "web/src/errors/mobile.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 deleted file mode 100644 index 3114022..0000000 --- a/web/pages/settings.go +++ /dev/null @@ -1,28 +0,0 @@ -package page - -import ( - "github.com/Redume/EveryNasa/functions" - "net/http" - "strings" -) - -func SettingsHandler(w http.ResponseWriter, r *http.Request) { - con := functions.Connected() - if con == false { - http.ServeFile(w, r, "web/src/errors/504.html") - return - } - - userAgent := r.UserAgent() - if strings.Contains(userAgent, "Mobile") { - http.ServeFile(w, r, "web/src/errors/mobile.html") - return - } - - if r.URL.Path != "/settings" { - http.ServeFile(w, r, "web/src/errors/404.html") - return - } - - http.ServeFile(w, r, "web/src/settings.html") -}