From: jw_wonny.cha Date: Thu, 11 Apr 2019 04:22:01 +0000 (+0900) Subject: running internal router in OrchestrationInit() X-Git-Tag: accepted/tizen/unified/20190415.132602~32^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38a72b99471c580a84c9542d3b4e1b16c1d6e329;p=platform%2Fcore%2Fsystem%2Fedge-orchestration.git running internal router in OrchestrationInit() Change-Id: I3eba9fc785e38ec7b609632e3577cfd17fbc3245 Signed-off-by: jw_wonny.cha --- diff --git a/src/interface/main.go b/src/interface/main.go index 6a1b90c..cc34a77 100755 --- a/src/interface/main.go +++ b/src/interface/main.go @@ -29,8 +29,10 @@ package main import "C" import ( + "fmt" "log" "logmgr" + "net/http" "securemgr" "strings" "sync" @@ -38,6 +40,7 @@ import ( configuremgr "configuremgr" discoverymgr "discoverymgr" orchestrationapi "orchestrationapi" + restapi "restapi/v1" scoringmgr "scoringmgr" servicemgr "servicemgr" ) @@ -71,6 +74,9 @@ func OrchestrationInit() (errCode C.int) { orcheEngine.IScoringmgr.Listening() go orcheEngine.IConfiguremgr.Watch("/etc/edge-orchestration") + router := restapi.NewRouter() + go http.ListenAndServe(fmt.Sprintf(":%d", ConstWellknownPort), router) + errCode = 0 return