chore: reorder part two

This commit is contained in:
DaanSelen
2026-04-23 15:58:02 +02:00
parent 0556bc4932
commit c3aac38089
15 changed files with 58 additions and 50 deletions
+6 -5
View File
@@ -2,16 +2,17 @@ package main
import (
"log/slog"
"orbits-server/internal/api"
"orbits-server/internal/database"
"orbits-server/internal/utility"
"orbits-server/internal/server/api"
"orbits-server/internal/server/bootstrap"
"orbits-server/internal/server/database"
"orbits-server/internal/shared/utility"
"os"
)
func main() {
// grab the environment variables from the runtime environment
// unfortunately since its before we configure the loglevel, we cannot use slog logging in those functions
env := utility.GrabEnvironment()
env := bootstrap.GrabEnvironment()
// configure the logger so we have nice json
level := utility.ParseSlogLevel(env.LogLevel) // defaults to Info
logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
@@ -26,7 +27,7 @@ func main() {
// checking directories to ensure its expected environment is ready
slog.Debug("checking if directories are present")
if err := utility.EnsureOperation(env.DataDirectory); err != nil {
if err := bootstrap.EnsureOperation(env.DataDirectory); err != nil {
slog.Error("failed to ensure the operating environment", "error", err)
os.Exit(1)
}