bzp2010 commented on code in PR #2583:
URL: https://github.com/apache/apisix-dashboard/pull/2583#discussion_r943086503


##########
web/config/defaultSettings.ts:
##########
@@ -42,3 +43,20 @@ export default {
     test: string;
   };
 };
+
+const { dev, test } = defaultSettings.serveUrlMap;
+const throwPromptError = (message: TemplateStringsArray) => {
+  throw new Error(
+    `Please set '${message[0]}' in 'web/.env' file. Guide: 
https://apisix.apache.org/docs/dashboard/develop/#web`,
+  );
+};
+
+if (REACT_APP_ENV === 'test' && !test) {
+  throwPromptError`SERVER_URL_TEST`;

Review Comment:
   LGTM, but should we use the most generic function call syntax? like 
`throwPromptError("SERVER_URL_TEST");`, although it still works, it may be 
confusing for those unfamiliar with it.



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