Files
next.orly.dev/app/main.go
mleku 8add32bb78 Add relayinfo package and utility modules for NIP-11 support
Introduce the `relayinfo` package with `NIP-11` utilities, including `Fees`, `Limits`, and `NIPs` structures. Add utility modules for handling numbers, timestamps, and kinds. Integrate functionality for fetching and managing relay information.
2025-08-21 15:22:17 +01:00

31 lines
510 B
Go

package app
import (
"context"
"fmt"
"net/http"
"lol.mleku.dev/log"
"next.orly.dev/app/config"
)
func Run(ctx context.Context, cfg *config.C) (quit chan struct{}) {
// shutdown handler
go func() {
select {
case <-ctx.Done():
log.I.F("shutting down")
close(quit)
}
}()
// start listener
l := &Listener{
Config: cfg,
}
addr := fmt.Sprintf("%s:%d", cfg.Listen, cfg.Port)
log.I.F("starting listener on %s", addr)
go http.ListenAndServe(addr, l)
quit = make(chan struct{})
return
}