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 2021/05/26 03:18:43 UTC

[GitHub] [apisix] vincentwc opened a new issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

vincentwc opened a new issue #4307:
URL: https://github.com/apache/apisix/issues/4307


   ### 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?
   看了一下源码,但是这个逻辑还是不太懂,一个创建route的http请求是怎么转到routes.lua的方法去的?在哪里配置的呢?希望可以帮忙解答一下,谢谢
   
   ### Environment
   
   Request help without environment information will be ignored or closed.
   
   * apisix version (cmd: `apisix version`): 2.5
   * OS (cmd: `uname -a`): 
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): nginx version: openresty/1.19.3.1
   * etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 3.4.0
   * apisix-dashboard version, if have: 2.5
   * luarocks version, if the issue is about installation (cmd: `luarocks --version`): 3.4.0
   


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



[GitHub] [apisix] vincentwc commented on issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
vincentwc commented on issue #4307:
URL: https://github.com/apache/apisix/issues/4307#issuecomment-849252735


   > this is a linux environment variable, there are many ways to set it, for example,
   > 
   > ```shell
   > export APISIX_PROFILE = prod
   > ```
   > 
   > and check it
   > 
   > ```shell
   > echo $APISIX_PROFILE
   > ```
   
    it will check the param in linux env not in apisix config? got it .thak you for your reply


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



[GitHub] [apisix] tzssangglass commented on issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #4307:
URL: https://github.com/apache/apisix/issues/4307#issuecomment-848722973


   this is a linux environment variable, there are many ways to set it, for example,
   
   ```shell
   export APISIX_PROFILE = prod
   ```
   and check it 
   
   ```shell
   echo $APISIX_PROFILE
   ```


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



[GitHub] [apisix] vincentwc closed issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
vincentwc closed issue #4307:
URL: https://github.com/apache/apisix/issues/4307


   


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



[GitHub] [apisix] Firstsawyou commented on issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4307:
URL: https://github.com/apache/apisix/issues/4307#issuecomment-848529402


   > one : env APISIX_PROFILE; What is the function of this parameter
   
   Please see here: https://github.com/apache/apisix/blob/master/docs/en/latest/profile.md
   
   > show as my picture ,why the obj apisix could call init.lua when function _M.init_http is defined local _M ?
   
   Corresponding files will be loaded from the path defined by `lua_package_path` (for example: apisix/init.lua, apisix.lua), you can understand the use of lua_package_path, you will be clear.
   
   https://github.com/apache/apisix/blob/f7c6f4fff765116898d48de0e07eb3728f36ee0d/apisix/cli/ngx_tpl.lua#L60-L61


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



[GitHub] [apisix] vincentwc commented on issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
vincentwc commented on issue #4307:
URL: https://github.com/apache/apisix/issues/4307#issuecomment-848482627


   > The interface of `/apisix/admin/*` is initialized in the `apisix/admin/init.lua` file. For details, please see: https://github.com/apache/apisix/blob/master/apisix/admin/init.lua
   
   i looked nginx.conf in /apisix/conf/nginx.conf , i don.t know how to use some settings
   such as 
   one :  env APISIX_PROFILE;  What is the function of this parameter
   two:  show as my picture ,why the obj  apisix could call init.lua when function  _M.init_http is defined local _M ? 
   ![image](https://user-images.githubusercontent.com/31959888/119609231-da47b080-be29-11eb-8a6b-a96cc58cda60.png)
   


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



[GitHub] [apisix] Firstsawyou commented on issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4307:
URL: https://github.com/apache/apisix/issues/4307#issuecomment-848432907


   The interface of `/apisix/admin/*` is initialized in the `apisix/admin/init.lua` file.  For details, please see: https://github.com/apache/apisix/blob/master/apisix/admin/init.lua


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



[GitHub] [apisix] vincentwc edited a comment on issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
vincentwc edited a comment on issue #4307:
URL: https://github.com/apache/apisix/issues/4307#issuecomment-848482627


   > The interface of `/apisix/admin/*` is initialized in the `apisix/admin/init.lua` file. For details, please see: https://github.com/apache/apisix/blob/master/apisix/admin/init.lua
   
   i looked nginx.conf in /apisix/conf/nginx.conf , i don.t know how to use some settings
   such as 
   one :  env APISIX_PROFILE;  What is the function of this parameter
         I have find it in docs/zh/latest/profile.md,but how to set APISIX_PROFILE = prod?
   two:  show as my picture ,why the obj  apisix could call init.lua when function  _M.init_http is defined local _M ? 
   ![image](https://user-images.githubusercontent.com/31959888/119609231-da47b080-be29-11eb-8a6b-a96cc58cda60.png)
   


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



[GitHub] [apisix] vincentwc commented on issue #4307: request help: 创建一个路由的时候,是怎么走到apisix/admin/routes.lua的_M.put方法的啊?

Posted by GitBox <gi...@apache.org>.
vincentwc commented on issue #4307:
URL: https://github.com/apache/apisix/issues/4307#issuecomment-848532519


   > > one : env APISIX_PROFILE; What is the function of this parameter
   > 
   > Please see here: https://github.com/apache/apisix/blob/master/docs/en/latest/profile.md
   > 
   > > show as my picture ,why the obj apisix could call init.lua when function _M.init_http is defined local _M ?
   > 
   > Corresponding files will be loaded from the path defined by `lua_package_path` (for example: apisix/init.lua, apisix.lua), you can understand the use of lua_package_path, you will be clear.
   > 
   > https://github.com/apache/apisix/blob/f7c6f4fff765116898d48de0e07eb3728f36ee0d/apisix/cli/ngx_tpl.lua#L60-L61
   
   thanks for your reply,  i had searched the file profile.md,but where i can set the APISIX_PROFILE value? or just used param in start apisix? hou to use ,please give me a demo,thanks


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