diff options
author | 2021-02-27 22:57:50 +0100 | |
---|---|---|
committer | 2021-02-27 22:57:50 +0100 | |
commit | fbf52fe84be071e90ea81e5f7951da2a1ece0dbf (patch) | |
tree | d2ebbef9a06a9b978c80fccfdc63deb99fb64db1 /internal/api/router.go | |
parent | first commit (diff) | |
download | gotosocial-fbf52fe84be071e90ea81e5f7951da2a1ece0dbf.tar.xz |
messing around a bit
Diffstat (limited to 'internal/api/router.go')
-rw-r--r-- | internal/api/router.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/api/router.go b/internal/api/router.go new file mode 100644 index 000000000..3b0570779 --- /dev/null +++ b/internal/api/router.go @@ -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() +} |