Files
openfsd/web/server.go
2025-05-12 17:21:16 -07:00

28 lines
423 B
Go

package main
import (
"context"
"github.com/renorris/openfsd/db"
)
type Server struct {
dbRepo *db.Repositories
jwtSecret []byte
}
func NewServer(dbRepo *db.Repositories, jwtSecret []byte) (server *Server, err error) {
server = &Server{
dbRepo: dbRepo,
jwtSecret: jwtSecret,
}
return
}
func (s *Server) Run(ctx context.Context, addr string) (err error) {
e := s.setupRoutes()
e.Run(addr)
return
}