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 2019/11/12 05:06:48 UTC

[GitHub] [incubator-apisix] membphis commented on issue #841: I'm trying to develop an ab-test plugin, how to implement it?

membphis commented on issue #841: I'm trying to develop an ab-test plugin, how to implement it?
URL: https://github.com/apache/incubator-apisix/issues/841#issuecomment-552736099
 
 
   You can make a try with this way:
   
   ```shell
   curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
   {
       "uri": "/index.html",
       "filter_func": "function(vars) return vars.arg_id and (vars.arg_id % 7 <= 4) end",
       "plugins": {
           "redirect": {
               "uri": "/test?group_id=234"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "39.97.63.215:80": 1
           }
       }
   }'
   
   
   curl -i http://127.0.0.1:9080/apisix/admin/routes/2 -X PUT -d '
   {
       "uri": "/index.html",
       "filter_func": "function(vars) return vars.arg_id and (vars.arg_id % 7 > 4) end",
       "plugins": {
           "redirect": {
               "uri": "/test?group_id=83838"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "39.97.63.215:80": 1
           }
       }
   }'
   ```

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


With regards,
Apache Git Services