running internal router in OrchestrationInit() 40/203240/1
authorjw_wonny.cha <jw_wonny.cha@samsung.com>
Thu, 11 Apr 2019 04:22:01 +0000 (13:22 +0900)
committerjw_wonny.cha <jw_wonny.cha@samsung.com>
Thu, 11 Apr 2019 04:22:01 +0000 (13:22 +0900)
Change-Id: I3eba9fc785e38ec7b609632e3577cfd17fbc3245
Signed-off-by: jw_wonny.cha <jw_wonny.cha@samsung.com>
src/interface/main.go

index 6a1b90c..cc34a77 100755 (executable)
@@ -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