added routes package and serve in server package
Build and Test / build-and-test-backend (push) Successful in 27s
Build and Test / build-and-test-frontend (push) Successful in 32s

This commit is contained in:
wt committed 2025-08-10 15:09:09 +07:00
1 parent 303b9344f8
commit 547949795f
8 files changed
+74 -77

No files matched your search

+1 -22
View File
@@ -2,33 +2,12 @@ package main
import (
"backend/server"
"log"
"os"
"strconv"
"github.com/gofiber/fiber/v2"
)
func main() {
app := fiber.New()
server.Configure(app)
enableTls, err := strconv.ParseBool(os.Getenv("ENABLE_TLS"))
if err != nil {
log.Fatalf("error read tls configuration, %v", err)
}
if enableTls {
log.Fatal(
app.ListenTLS(
os.Getenv("HTTP_ADDRESS"),
os.Getenv("CERT_FILE"),
os.Getenv("KEY_FILE"),
),
)
} else {
log.Fatal(
app.Listen(os.Getenv("HTTP_ADDRESS")),
)
}
server.Serve(app)
}