mirror of
https://forgejo.merr.is/annika/isl-api.git
synced 2025-12-10 11:53:14 -05:00
Cleaned Up Logging And Variables
This commit is contained in:
parent
b5ea01729b
commit
f483833260
1 changed files with 2 additions and 6 deletions
8
main.go
8
main.go
|
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
|
|
@ -18,7 +17,6 @@ import (
|
|||
"github.com/go-chi/cors"
|
||||
"github.com/go-chi/httplog/v2"
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
"github.com/lestrrat-go/jwx/v2/jwk"
|
||||
"github.com/lmittmann/tint"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
|
@ -48,9 +46,9 @@ func main() {
|
|||
deps := dependencies{}
|
||||
deps.initializeDependencies()
|
||||
|
||||
fmt.Printf("Preparing to listen on `:%v`\n", conf.HttpPort)
|
||||
logger.Info(fmt.Sprintf("Preparing to listen on `:%v`", conf.HttpPort))
|
||||
err := http.ListenAndServe(fmt.Sprintf(":%v", conf.HttpPort), deps.router)
|
||||
log.Fatal(err)
|
||||
logger.Error("Error starting server", "error", err)
|
||||
}
|
||||
|
||||
func setupConfig() {
|
||||
|
|
@ -78,11 +76,9 @@ type dependencies struct {
|
|||
router *chi.Mux
|
||||
postgresConnection *pgxpool.Pool
|
||||
context context.Context
|
||||
jwkContext context.Context
|
||||
powerItemQuerier *powerItem.DBQuerier
|
||||
powerItemService *services.PowerItemService
|
||||
powerItemController *controllers.PowerItemController
|
||||
jwkCache *jwk.Cache
|
||||
}
|
||||
|
||||
func (d *dependencies) initializeDependencies() error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue