feat: init commit

This commit is contained in:
DaanSelen
2026-04-20 16:58:20 +02:00
parent 5b84b3ed1d
commit 4b783b50fb
14 changed files with 495 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
package main
+39
View File
@@ -0,0 +1,39 @@
package main
import (
"eden-server/internal/api"
"eden-server/internal/database"
"eden-server/internal/runtime"
"log/slog"
"os"
"github.com/gin-gonic/gin"
)
func main() {
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
slog.SetDefault(logger)
// grab the environment variables from the runtime environment
slog.Info("grabbing environment variables")
env := runtime.GrabEnvironment()
// checking directories to ensure its expected environment is ready
slog.Info("ensuring operating environment")
if err := runtime.EnsureOperation(env.WorkDir); err != nil {
slog.Error("failed to ensure the operating environment", "error", err)
os.Exit(1)
}
// initiating the database connection for which we safe things
slog.Info("kicking off database connection")
db, err := database.KickoffDatabase()
if err != nil {
slog.Error("failed to initiate a database connection")
}
// get ready to kick off the http api
slog.Info("kicking off http api, letting gin take over")
gin.SetMode(gin.ReleaseMode)
api.KickoffApi(env, db)
}