Kong API Gateway Helloworld

Submitted by Lizhe on Fri, 06/01/2018 - 09:09

 

 

[admin@localhost ~]$ curl -i -X POST http://localhost:8001/apis/ -d "name=helloworld" -d "uris=/helloworld" -d "upstream_url=http://www.baidu.com"
HTTP/1.1 201 Created
Date: Fri, 01 Jun 2018 01:59:15 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Server: kong/0.13.1

{"created_at":1527847155191,"strip_uri":true,"id":"6547743f-55c8-418f-83fd-53f293a29a0c","name":"helloworld","http_if_terminated":false,"preserve_host":false,"upstream_url":"http:\/\/www.baidu.com","uris":["\/helloworld"],"upstream_connect_timeout":60000,"upstream_send_timeout":60000,"upstream_read_timeout":60000,"retries":5,"https_only":false}
[admin@localhost ~]$ 
 

807

808

然后直接访问上面配置的地址就可以得到转发到的内容

809