go first commit
This commit is contained in:
26
go_cloud/internal/http/server.go
Normal file
26
go_cloud/internal/http/server.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"go.b0esche.cloud/backend/internal/audit"
|
||||
"go.b0esche.cloud/backend/internal/auth"
|
||||
"go.b0esche.cloud/backend/internal/config"
|
||||
"go.b0esche.cloud/backend/internal/database"
|
||||
"go.b0esche.cloud/backend/pkg/jwt"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
*http.Server
|
||||
}
|
||||
|
||||
func New(cfg *config.Config, db *database.DB, jwtManager *jwt.Manager, authService *auth.Service, auditLogger *audit.Logger) *Server {
|
||||
r := NewRouter(cfg, db, jwtManager, authService, auditLogger)
|
||||
|
||||
return &Server{
|
||||
Server: &http.Server{
|
||||
Addr: cfg.ServerAddr,
|
||||
Handler: r,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user