This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/internal/api/api.go

25 lines
430 B
Go
Raw Normal View History

2021-01-16 22:00:17 +00:00
package api
import (
"net/http"
"reichard.io/imagini/internal/db"
"reichard.io/imagini/internal/auth"
)
type API struct {
Router *http.ServeMux
Auth *auth.AuthManager
DB *db.DBManager
}
func NewApi(db *db.DBManager, auth *auth.AuthManager) *API {
api := &API{
2021-01-18 04:56:56 +00:00
Router: http.NewServeMux(),
Auth: auth,
DB: db,
2021-01-16 22:00:17 +00:00
}
api.registerRoutes()
return api
}