Skip to content
Snippets Groups Projects
Select Git revision
  • a849a2ae815ac3f2954c40c5dc915d8f4df5f7e6
  • main default protected
2 results

server.go

Blame
  • user avatar
    Kevin Lyda authored
    a849a2ae
    History
    server.go 453 B
    // Package server implements the server.
    package server
    
    import (
    	"fmt"
    
    	"git.lyda.ie/kevin/boxes/api"
    	"github.com/labstack/echo/v4"
    	"github.com/spf13/cobra"
    )
    
    // StartServer starts the metrics and API servers.
    func StartServer(_ *cobra.Command, _ []string) {
    	e := echo.New()
    	endpoints := NewEndpoints()
    	server := api.NewStrictHandler(endpoints, nil)
    	api.RegisterHandlers(e, server)
    	fmt.Printf("Server exited with: %+v\n", e.Start(":8070"))
    }