You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/08/11 04:29:37 UTC

[GitHub] [apisix-dashboard] bzp2010 commented on a diff in pull request #2583: feat: set serverUrlMap using environment variables

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: notifications-unsubscribe@apisix.apache.org

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