This commit is contained in:
Fran Jurmanović
2024-07-09 23:42:26 +02:00
commit 1bb73c866a
15 changed files with 425 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package server
import (
"acc-server-manager/local/utl/common"
"fmt"
"os"
"github.com/gofiber/fiber/v2"
)
func Start(r *fiber.App) *fiber.App {
r.Get("/ping", func(c *fiber.Ctx) error {
return c.SendString("pong")
})
port := os.Getenv("PORT")
if port == "" {
port = "4000"
}
err := r.Listen(":" + port)
if err != nil {
msg := fmt.Sprintf("Running on %s:%s", common.GetIP(), port)
println(msg)
}
return r
}