mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 06:02:26 -05:00
messing around a bit
This commit is contained in:
parent
503b77b768
commit
fbf52fe84b
8 changed files with 124 additions and 0 deletions
36
internal/api/router.go
Normal file
36
internal/api/router.go
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package api
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
// Router provides the http routes used by the API
|
||||
type Router interface {
|
||||
Route()
|
||||
}
|
||||
|
||||
// NewRouter returns a new router
|
||||
func NewRouter() Router {
|
||||
return &router{}
|
||||
}
|
||||
|
||||
// router implements the router interface
|
||||
type router struct {
|
||||
|
||||
}
|
||||
|
||||
func (r *router) Route() {
|
||||
ginRouter := gin.Default()
|
||||
ginRouter.LoadHTMLGlob("web/template/*")
|
||||
|
||||
apiGroup := ginRouter.Group("/api")
|
||||
{
|
||||
v1 := apiGroup.Group("/v1")
|
||||
{
|
||||
statusesGroup := v1.Group("/statuses")
|
||||
{
|
||||
statusesGroup.GET(":id", statusGet)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
ginRouter.Run()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue