mirror of
https://github.com/elyby/chrly.git
synced 2025-05-31 14:11:51 +05:30
Implemented API endpoint to update skin information
Added tests to jwt package Reworked redis backend implementation Skin repository now have methods to remove skins by user id or username
This commit is contained in:
@@ -22,6 +22,7 @@ type Config struct {
|
||||
SkinsRepo interfaces.SkinsRepository
|
||||
CapesRepo interfaces.CapesRepository
|
||||
Logger wd.Watchdog
|
||||
Auth interfaces.AuthChecker
|
||||
}
|
||||
|
||||
func (cfg *Config) Run() error {
|
||||
@@ -59,6 +60,8 @@ func (cfg *Config) CreateHandler() http.Handler {
|
||||
// Legacy
|
||||
router.HandleFunc("/skins", cfg.SkinGET).Methods("GET")
|
||||
router.HandleFunc("/cloaks", cfg.CapeGET).Methods("GET")
|
||||
// API
|
||||
router.Handle("/api/skins", cfg.Authenticate(http.HandlerFunc(cfg.PostSkin))).Methods("POST")
|
||||
// 404
|
||||
router.NotFoundHandler = http.HandlerFunc(cfg.NotFound)
|
||||
|
||||
|
Reference in New Issue
Block a user