feat(api): fix POST /invoice
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user