bisakhmondal commented on a change in pull request #1788:
URL: https://github.com/apache/apisix-dashboard/pull/1788#discussion_r622099631



##########
File path: api/internal/route.go
##########
@@ -54,10 +55,13 @@ func SetUpRouter() *gin.Engine {
        r := gin.New()
        logger := log.GetLogger(log.AccessLog)
        r.Use(filter.CORS(), filter.RequestId(), filter.IPFilter(), 
filter.RequestLogHandler(logger), filter.SchemaCheck(), filter.RecoverHandler())
-       r.Use(static.Serve("/", static.LocalFile(filepath.Join(conf.WorkDir, 
conf.WebDir), false)))
-       r.NoRoute(func(c *gin.Context) {
-               c.File(fmt.Sprintf("%s/index.html", filepath.Join(conf.WorkDir, 
conf.WebDir)))
-       })
+       filesystem := fs.FS(StaticFiles)
+       subtree, err := fs.Sub(filesystem, "html")
+
+       if err != nil {
+               log.Errorf("%s\n", err)

Review comment:
       Okay!! I thought users could opt to operate through CLI even without the 
UI, so skipped intentionally.
   changing..

##########
File path: api/test/shell/cli_test.sh
##########
@@ -118,45 +118,45 @@ if [[ `grep -c "INFO" ./error.log` -eq '0' ]]; then
 fi
 
 # run on a different path
-workDir=$(pwd)
-rm -rf html
-mkdir html
-cd html
-echo "hi~" >> index.html
-APISIX_API_WORKDIR=$workDir $workDir/manager-api &
-sleep 5
-
-res=$(curl http://127.0.0.1:9000)
-$workDir/manager-api stop
-sleep 6
-cd -
-rm -rf html
-
-if [[ $res != "hi~" ]]; then
-    echo "failed: manager-api cant run on a different path"
-    exit 1
-fi
+# workDir=$(pwd)

Review comment:
       Cool




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to