hello world
This commit is contained in:
32
endpoints/endpoints.go
Normal file
32
endpoints/endpoints.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package endpoints
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func Run() {
|
||||
r := gin.Default()
|
||||
|
||||
public := r.Group("/")
|
||||
|
||||
public.POST("/login", login) //web login
|
||||
public.POST("/access", func(c *gin.Context) {}) //access token
|
||||
|
||||
private := r.Group("/")
|
||||
private.Use(userIsAuthorized)
|
||||
|
||||
private.POST("/user", user) //change username/password (required before adding bots)
|
||||
|
||||
private.GET("/bots", func(c *gin.Context) {}) //generalized list of bots
|
||||
private.GET("/bot/:bot", func(c *gin.Context) {}) //specific bot
|
||||
private.POST("/bot/", func(c *gin.Context) {}) //add bot given token
|
||||
private.DELETE("/bot/:bot", func(c *gin.Context) {}) //remove bot
|
||||
|
||||
private.GET("/tokens", func(c *gin.Context) {}) //generalized list of tokens
|
||||
private.GET("/token/:token", func(c *gin.Context) {}) //specific token
|
||||
private.POST("/token/", func(c *gin.Context) {}) //new token given bot (so you cant add a token if theres no bots)
|
||||
private.DELETE("/token/:token", func(c *gin.Context) {}) //remove token
|
||||
private.PATCH("/token/:token", func(c *gin.Context) {}) //update token given bot
|
||||
|
||||
r.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user