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

This commit is contained in:
Данил 2022-10-23 15:26:51 +03:00
parent 42f568cf85
commit 16301a3428
8 changed files with 102 additions and 47 deletions

15
web/page/about.go Normal file
View file

@ -0,0 +1,15 @@
package page
import (
"github.com/Redume/EveryNasa/functions"
"github.com/gofiber/fiber/v2"
)
func About(c *fiber.Ctx) error {
con := functions.Connected()
if con == false {
return c.SendFile("./web/errors/500.html")
}
return c.SendFile("./web/src/about.html")
}

15
web/page/gallery.go Normal file
View file

@ -0,0 +1,15 @@
package page
import (
"github.com/Redume/EveryNasa/functions"
"github.com/gofiber/fiber/v2"
)
func Gallery(c *fiber.Ctx) error {
con := functions.Connected()
if con == false {
return c.SendFile("./web/errors/500.html")
}
return c.SendFile("./web/src/gallery.html")
}

15
web/page/settings.go Normal file
View file

@ -0,0 +1,15 @@
package page
import (
"github.com/Redume/EveryNasa/functions"
"github.com/gofiber/fiber/v2"
)
func Settings(c *fiber.Ctx) error {
con := functions.Connected()
if con == false {
return c.SendFile("./web/errors/500.html")
}
return c.SendFile("./web/src/settings.html")
}