lot of new functionalities
This commit is contained in:
26
servers/web/api/protected/handler.go
Normal file
26
servers/web/api/protected/handler.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package protected
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/core/application"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
apiKey string
|
||||
config *viper.Viper
|
||||
applicationHandler *application.ApplicationHandler
|
||||
}
|
||||
|
||||
func NewHandler(cfg *viper.Viper, appHandler *application.ApplicationHandler) *Handler {
|
||||
return &Handler{
|
||||
apiKey: cfg.GetString("services.api.api_key"),
|
||||
config: cfg,
|
||||
applicationHandler: appHandler,
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) NotFound(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
}
|
||||
Reference in New Issue
Block a user