going-further/cmd/furthur/main.go

27 lines
420 B
Go
Raw Normal View History

2024-04-22 02:07:01 +00:00
package main
2024-04-23 01:53:20 +00:00
import (
"log/slog"
"os"
"os/signal"
"git.yetaga.in/alazyreader/going-further/api"
)
func main() {
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)).
With(slog.String("application", "furthur"))
slog.SetDefault(logger)
server := api.NewServer(logger, "8080", "v0.0.1")
start, stop := server.Setup()
start()
c := make(chan os.Signal, 2)
signal.Notify(c, os.Interrupt)
<-c
stop()
}