feat(api): fix POST /invoice

This commit is contained in:
2025-08-26 22:40:49 +02:00
parent 788571162d
commit 794558a007
12 changed files with 181 additions and 84 deletions

View File

@@ -5,22 +5,15 @@ import (
"os"
"git.schreifuchs.ch/lou-taylor/accounting/internal/api"
"git.schreifuchs.ch/lou-taylor/accounting/internal/config"
)
func main() {
// var cfg invoice.Config
// file, err := os.Open("config.json")
// if err != nil {
// panic(err)
// }
// defer file.Close()
// decoder := json.NewDecoder(file)
// err = decoder.Decode(&cfg)
// if err != nil {
// panic(err)
// }
//
// invoice.Generate(cfg)
cfg, err := config.Load("config.json")
if err != nil {
panic(err)
}
log := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug}))
api.Start(log, ":8080")
api.Start(log, ":8080", cfg)
}