mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-12-24 13:53:46 +03:00
change name folder, project file optimization
This commit is contained in:
parent
dfa190056e
commit
b72629c751
1 changed files with 19 additions and 9 deletions
28
main.go
28
main.go
|
@ -2,8 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/api/controllers"
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/Redume/EveryNasa/web/page"
|
||||
"github.com/Redume/EveryNasa/utils"
|
||||
"github.com/getlantern/systray"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
|
@ -12,11 +11,12 @@ import (
|
|||
|
||||
func main() {
|
||||
go open.Run("http://localhost:3000")
|
||||
go functions.Database()
|
||||
go systray.Run(functions.Tray, functions.Quit)
|
||||
go functions.StartWallpaper()
|
||||
go utils.Database()
|
||||
go systray.Run(utils.Tray, utils.Quit)
|
||||
go utils.StartWallpaper()
|
||||
|
||||
app := fiber.New()
|
||||
|
||||
app = fiber.New(fiber.Config{
|
||||
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
|
||||
code := fiber.StatusInternalServerError
|
||||
|
@ -37,16 +37,26 @@ func main() {
|
|||
app.Use(cors.New())
|
||||
|
||||
app.Get("/", func(c *fiber.Ctx) error {
|
||||
return page.Gallery(c)
|
||||
con := utils.Connected()
|
||||
if con == false {
|
||||
return c.SendFile("./web/errors/500.html")
|
||||
}
|
||||
|
||||
return c.SendFile("./web/page/gallery.html")
|
||||
})
|
||||
app.Get("/settings", func(c *fiber.Ctx) error {
|
||||
return page.Settings(c)
|
||||
con := utils.Connected()
|
||||
if con == false {
|
||||
return c.SendFile("./web/errors/500.html")
|
||||
}
|
||||
|
||||
return c.SendFile("./web/page/settings.html")
|
||||
})
|
||||
app.Get("/about", func(c *fiber.Ctx) error {
|
||||
return page.About(c)
|
||||
return c.SendFile("./web/page/about.html")
|
||||
})
|
||||
app.Get("/favorite", func(c *fiber.Ctx) error {
|
||||
return page.Favorite(c)
|
||||
return c.SendFile("./web/page/favorite.html")
|
||||
})
|
||||
|
||||
api := app.Group("/api")
|
||||
|
|
Loading…
Add table
Reference in a new issue