Changed server handlers to use public and protected routes correctly with auth

This commit is contained in:
David Allen 2024-07-03 11:42:27 -06:00
parent 7836aef5c3
commit bf937bf4d4
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
2 changed files with 69 additions and 47 deletions

View file

@ -51,6 +51,7 @@ var serveCmd = &cobra.Command{
// set up the routes and start the server
server := server.Server{
Config: &config,
Server: &http.Server{
Addr: fmt.Sprintf("%s:%d", config.Server.Host, config.Server.Port),
},
@ -65,7 +66,7 @@ var serveCmd = &cobra.Command{
Verbose: verbose,
},
}
err := server.Serve(&config)
err := server.Serve()
if errors.Is(err, http.ErrServerClosed) {
fmt.Printf("Server closed.")
} else if err != nil {