This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
route.go
54 lines (47 loc) · 1.82 KB
/
route.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package core
import (
"net/http"
"github.com/factly/dega-server/service/core/action/event"
"github.com/factly/dega-server/service/core/action/info"
"github.com/factly/dega-server/service/core/action/menu"
"github.com/factly/dega-server/service/core/action/page"
"github.com/factly/dega-server/service/core/action/permissions"
"github.com/factly/dega-server/service/core/action/request"
"github.com/factly/dega-server/service/core/action/webhook"
"github.com/factly/dega-server/util"
"github.com/go-chi/chi"
"github.com/factly/dega-server/service/core/action/author"
"github.com/factly/dega-server/service/core/action/category"
"github.com/factly/dega-server/service/core/action/format"
"github.com/factly/dega-server/service/core/action/medium"
"github.com/factly/dega-server/service/core/action/policy"
"github.com/factly/dega-server/service/core/action/post"
"github.com/factly/dega-server/service/core/action/search"
"github.com/factly/dega-server/service/core/action/space"
"github.com/factly/dega-server/service/core/action/tag"
"github.com/factly/dega-server/service/core/action/user"
)
// Router - CRUD servies
func Router() http.Handler {
r := chi.NewRouter()
r.Mount("/media", medium.Router())
r.Mount("/menus", menu.Router())
r.Mount("/categories", category.Router())
r.Mount("/formats", format.Router())
r.Mount("/tags", tag.Router())
r.Mount("/spaces", space.Router())
r.Mount("/posts", post.Router())
r.Mount("/pages", page.Router())
r.Mount("/policies", policy.Router())
r.Mount("/authors", author.Router())
r.Mount("/search", search.Router())
r.Mount("/users", user.Router())
r.Mount("/permissions", permissions.Router())
r.Mount("/requests", request.Router())
r.Mount("/info", info.Router())
if util.CheckNats() {
r.Mount("/webhooks", webhook.Router())
r.Mount("/events", event.Router())
}
return r
}