feat(invoice): add send route
This commit is contained in:
23
internal/api/api.go
Normal file
23
internal/api/api.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user