page handler

This commit is contained in:
Данил 2022-09-18 19:28:19 +03:00
parent 06a28ecbc9
commit 253988c4eb
3 changed files with 36 additions and 0 deletions

7
web/pages/about.go Normal file
View file

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

22
web/pages/index.go Normal file
View file

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

7
web/pages/settings.go Normal file
View file

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