feat(invoice): add send route

This commit is contained in:
2025-08-26 20:30:48 +02:00
parent 958979c62b
commit 788571162d
35 changed files with 451 additions and 193 deletions

23
internal/api/api.go Normal file
View File

@@ -0,0 +1,23 @@
package api
import (
"fmt"
"log/slog"
"net/http"
"time"
)
func Start(log *slog.Logger, address string) error {
mux := http.NewServeMux()
RegisterRoutes(log, mux)
s := &http.Server{
Addr: address,
Handler: mux,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
MaxHeaderBytes: 1 << 20,
}
log.Info(fmt.Sprintf("Start API on %s", address))
return s.ListenAndServe()
}