feat: scaffold go backend foundation
This commit is contained in:
19
internal/app/server.go
Normal file
19
internal/app/server.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"tutor/internal/config"
|
||||
"tutor/internal/httpapi"
|
||||
"tutor/internal/workflows"
|
||||
)
|
||||
|
||||
func NewServer(cfg config.Config) *http.Server {
|
||||
runner := workflows.NewStubRunner()
|
||||
handler := httpapi.NewHandler(cfg, runner)
|
||||
|
||||
return &http.Server{
|
||||
Addr: cfg.HTTPAddr,
|
||||
Handler: handler.Routes(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user