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 2020/11/04 02:07:47 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #2101: feat: customed config.yaml when apisix start

spacewander commented on a change in pull request #2101:
URL: https://github.com/apache/apisix/pull/2101#discussion_r517053138



##########
File path: bin/apisix
##########
@@ -668,6 +668,23 @@ function _M.start(...)
         end
     end
 
+    local argparse = require "argparse"
+    local parser = argparse()
+    parser:argument("_", "Placeholder")
+    parser:option("-c --config", "location of customed config.yaml")

Review comment:
       Should be `customized`? Please change other similar places

##########
File path: doc/architecture-design.md
##########
@@ -45,15 +45,17 @@
 
 ## APISIX Config
 
-For example, set the default listening port of APISIX to 8000, and keep other configurations as default. The configuration in `conf/config.yaml` should be like this:
+There are two methods to configure APISIX: directly change `conf/config.yaml`, or add file path argument when start APISIX like `apisix start -c /opts/apisix/config.yaml`

Review comment:
       Better to mention `--config` option too.

##########
File path: bin/apisix
##########
@@ -631,7 +631,7 @@ local function init_etcd(show_output)
                 break
             end
 
-            if show_output then
+            if show_output and show_output ~= "-c" then

Review comment:
       It would be better to pass the argument explicitly. Filter out all the other options is error-prone. For example, is `--config` handled?

##########
File path: doc/architecture-design.md
##########
@@ -45,15 +45,17 @@
 
 ## APISIX Config
 
-For example, set the default listening port of APISIX to 8000, and keep other configurations as default. The configuration in `conf/config.yaml` should be like this:
+There are two methods to configure APISIX: directly change `conf/config.yaml`, or add file path argument when start APISIX like `apisix start -c /opts/apisix/config.yaml`
+
+For example, set the default listening port of APISIX to 8000, and keep other configurations as default. The configuration in `config.yaml` should be like this:
 
 ```yaml
 apisix:
   node_listen: 8000             # APISIX listening port
 ```
 
 Set the default listening port of APISIX to 8000, set the `etcd` address to `http://foo:2379`,
-and keep other configurations as default. The configuration in `conf/config.yaml` should be like this:

Review comment:
       Why remove the `conf/`?




----------------------------------------------------------------
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:
users@infra.apache.org