You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by we...@apache.org on 2020/05/16 03:37:22 UTC

[incubator-apisix-docker] branch master updated: Adding api key to header and intro to lvh.me (#48)

This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-docker.git


The following commit(s) were added to refs/heads/master by this push:
     new 0e37dac  Adding api key to header and intro to lvh.me (#48)
0e37dac is described below

commit 0e37dac922a8543c549da667b757fcfa4431544a
Author: Nirojan Selvanathan <ss...@gmail.com>
AuthorDate: Sat May 16 05:37:15 2020 +0200

    Adding api key to header and intro to lvh.me (#48)
---
 example/README.md | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/example/README.md b/example/README.md
index 397553c..48d34b7 100644
--- a/example/README.md
+++ b/example/README.md
@@ -7,7 +7,7 @@ $ docker-compose -p docker-apisix up -d
 ### Configure
 
 ```
-curl http://127.0.0.1:9080/apisix/admin/services/1 -X PUT -d '
+curl http://127.0.0.1:9080/apisix/admin/services/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "upstream": {
         "type": "roundrobin",
@@ -17,7 +17,7 @@ curl http://127.0.0.1:9080/apisix/admin/services/1 -X PUT -d '
     }
 }'
 
-curl http://127.0.0.1:9080/apisix/admin/services/2 -X PUT -d '
+curl http://127.0.0.1:9080/apisix/admin/services/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "upstream": {
         "type": "roundrobin",
@@ -27,42 +27,42 @@ curl http://127.0.0.1:9080/apisix/admin/services/2 -X PUT -d '
     }
 }'
 
-curl http://127.0.0.1:9080/apisix/admin/routes/11 -X PUT -d '
+curl http://127.0.0.1:9080/apisix/admin/routes/11 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "uri": "/",
     "host": "web1.lvh.me",
     "service_id": "1"
 }'
 
-curl http://127.0.0.1:9080/apisix/admin/routes/12 -X PUT -d '
+curl http://127.0.0.1:9080/apisix/admin/routes/12 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "uri": "/{:.*}",
     "host": "web1.lvh.me",
     "service_id": "1"
 }'
 
-curl http://127.0.0.1:9080/apisix/admin/routes/21 -X PUT -d '
+curl http://127.0.0.1:9080/apisix/admin/routes/21 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "uri": "/",
     "host": "web2.lvh.me",
     "service_id": "2"
 }'
 
-curl http://127.0.0.1:9080/apisix/admin/routes/22 -X PUT -d '
+curl http://127.0.0.1:9080/apisix/admin/routes/22 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "uri": "/{:.*}",
     "host": "web2.lvh.me",
     "service_id": "2"
 }'
 
-curl http://127.0.0.1:9080/apisix/admin/ssl/1 -X PUT -d "
+curl http://127.0.0.1:9080/apisix/admin/ssl/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d "
 {
     \"cert\": \"$( cat './mkcert/lvh.me+1.pem')\",
     \"key\": \"$( cat './mkcert/lvh.me+1-key.pem')\",
     \"sni\": \"lvh.me\"
 }"
 
-curl http://127.0.0.1:9080/apisix/admin/ssl/2 -X PUT -d "
+curl http://127.0.0.1:9080/apisix/admin/ssl/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d "
 {
     \"cert\": \"$( cat './mkcert/lvh.me+1.pem')\",
     \"key\": \"$( cat './mkcert/lvh.me+1-key.pem')\",
@@ -72,6 +72,9 @@ curl http://127.0.0.1:9080/apisix/admin/ssl/2 -X PUT -d "
 
 ### Test
 
+When testing subdomains, using localhost is not a good option. Due to this, lets use [http://lvh.me/](http://lvh.me/)
+free service to resolve itself along with all subdomains to localhost.
+
 ```
 curl http://web1.lvh.me:9080/ -v # web1.txt
 curl http://web1.lvh.me:9080/web1.txt -v # web1