1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00

use oauth for file uploads

This commit is contained in:
2018-02-19 16:06:33 -06:00
parent 79b4fecd3c
commit 02fe8e1748
16 changed files with 490 additions and 286 deletions

View File

@@ -4,6 +4,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/mgerb/go-discord-bot/server/config"
"github.com/mgerb/go-discord-bot/server/webserver/handlers"
"github.com/mgerb/go-discord-bot/server/webserver/middleware"
"github.com/mgerb/go-discord-bot/server/webserver/pubg"
)
@@ -24,9 +25,12 @@ func getRouter() *gin.Engine {
api.GET("/ytdownloader", handlers.Downloader)
api.GET("/soundlist", handlers.SoundList)
api.GET("/cliplist", handlers.ClipList)
api.POST("/upload", handlers.FileUpload)
api.POST("/oauth", handlers.Oauth)
authorizedAPI := router.Group("/api")
authorizedAPI.Use(middleware.AuthorizedJWT())
authorizedAPI.POST("/upload", handlers.FileUpload)
return router
}