mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-11-06 06:13:57 +03:00
29 lines
538 B
Go
29 lines
538 B
Go
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")
|
|
}
|