jwrookie commented on code in PR #2454:
URL: https://github.com/apache/apisix-dashboard/pull/2454#discussion_r894272877


##########
api/test/shell/cli_test.sh:
##########
@@ -483,6 +483,39 @@ stop_dashboard() {
   stop_dashboard 6
 }
 
+#16
+@test "Check route prefix" {
+  recover_conf
+
+  # modify route prefix config to /test
+  if [[ $KERNEL = "Darwin" ]]; then
+      sed -i "" 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+    else
+      sed -i 's/route_prefix: \//route_prefix: \/test/g' ${CONF_FILE}
+  fi
+
+  mkdir -p /usr/local/apisix-dashboard/html
+  echo "hi~" > /usr/local/apisix-dashboard/html/index.html
+
+  start_dashboard 3
+
+  # check api
+  run curl http://127.0.0.1:9000/test/apisix/admin/user/login -H 
"Content-Type: application/json" -d '{"username":"admin", "password": "admin"}'
+  respCode=$(echo "$output" | sed 's/{/\n/g'| sed 's/,/\n/g' | grep "code" | 
sed 's/:/\n/g' | sed '1d')
+  echo $respCode
+  [ "$respCode" = "0" ]
+
+  # 404
+  result=$(curl "http://127.0.0.1:9000/apisix/admin/user/login";)
+  [ "$result" = "hi~" ]

Review Comment:
   404 was handled
   
   
https://github.com/apache/apisix-dashboard/blob/a2fe71d0644927eb71ef3dd06b902ea9f4ce81f6/api/internal/route.go#L52-L65



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to