chore: reorder part two
This commit is contained in:
+6
-5
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user