mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
moving endpoints to new API (WIP)
This commit is contained in:
parent
27640dffc4
commit
72b14def6d
36 changed files with 1371 additions and 472 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
"github.com/documize/community/core/api/plugins"
|
||||
"github.com/documize/community/core/database"
|
||||
"github.com/documize/community/core/env"
|
||||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/server/routing"
|
||||
"github.com/documize/community/server/web"
|
||||
"github.com/gorilla/mux"
|
||||
|
@ -30,8 +31,7 @@ import (
|
|||
var testHost string // used during automated testing
|
||||
|
||||
// Start router to handle all HTTP traffic.
|
||||
func Start(rt *env.Runtime, ready chan struct{}) {
|
||||
|
||||
func Start(rt *env.Runtime, s *domain.Store, ready chan struct{}) {
|
||||
err := plugins.LibSetup()
|
||||
if err != nil {
|
||||
rt.Log.Error("Terminating before running - invalid plugin.json", err)
|
||||
|
@ -54,10 +54,10 @@ func Start(rt *env.Runtime, ready chan struct{}) {
|
|||
}
|
||||
|
||||
// define middleware
|
||||
cm := middleware{Runtime: rt}
|
||||
cm := middleware{Runtime: rt, Store: s}
|
||||
|
||||
// define API endpoints
|
||||
routing.RegisterEndpoints(rt)
|
||||
routing.RegisterEndpoints(rt, s)
|
||||
|
||||
// wire up API endpoints
|
||||
router := mux.NewRouter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue