rewritten from net/http to fiber, changed port from 8080, 4662 to one 3000

This commit is contained in:
Данил 2022-10-23 15:27:09 +03:00
parent 16301a3428
commit c09c3d7886
3 changed files with 0 additions and 85 deletions

View file

@ -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")
}

View file

@ -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")
}

View file

@ -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")
}