improve documentation
This commit is contained in:
parent
232463e1db
commit
0826963742
16 changed files with 80 additions and 28 deletions
|
|
@ -18,7 +18,7 @@ import (
|
|||
"github.com/go-chi/render"
|
||||
)
|
||||
|
||||
// NewAPI configures application resources and routes
|
||||
// NewAPI configures application resources and routes.
|
||||
func NewAPI() (*chi.Mux, error) {
|
||||
logger := logging.NewLogger()
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ func corsConfig() *cors.Cors {
|
|||
})
|
||||
}
|
||||
|
||||
// SPAHandler serves the public Single Page Application
|
||||
// SPAHandler serves the public Single Page Application.
|
||||
func SPAHandler(publicDir string) http.HandlerFunc {
|
||||
handler := http.FileServer(http.Dir(publicDir))
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// Server provides an http.Server
|
||||
// Server provides an http.Server.
|
||||
type Server struct {
|
||||
*http.Server
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ func NewServer() (*Server, error) {
|
|||
return &Server{&srv}, nil
|
||||
}
|
||||
|
||||
// Start runs ListenAndServe on the http.Server with graceful shutdown
|
||||
// Start runs ListenAndServe on the http.Server with graceful shutdown.
|
||||
func (srv *Server) Start() {
|
||||
log.Println("starting server...")
|
||||
go func() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue