Open tiancheng91 opened 5 years ago
add service
curl -i -X POST \ --url http://localhost:8001/services/ \ --data 'name=example-service' \ --data 'url=http://mockbin.org'
Add a Route for the Service (一个服务可以给添加到多个路由上)
curl -i -X POST \ --url http://localhost:8001/services/example-service/routes \ --data 'hosts[]=example.com&path=/'
enable plugin
curl -i -X POST \ --url http://localhost:8001/services/example-service/plugins/ \ --data 'name=key-auth'
consumer (某个服务的某个用户)
curl -i -X POST \ --url http://localhost:8001/consumers/ \ --data "username=test"
curl -i -X POST \ --url http://localhost:8001/consumers/test/key-auth/ \ --data 'key=test'
curl -i -H "apikey: test" -H "Host: example.com" localost
5: Certificate ```bash # 新增证书 curl -i -X POST \ --url http://localhost:8001/certificates \ --data 'cert=pem_public_cert&key=pem_private_key&sni[]=*.domain.com' # 更新证书 curl -i -X PUT /certificates/{certificate id}
quick start
add service
Add a Route for the Service (一个服务可以给添加到多个路由上)
enable plugin
consumer (某个服务的某个用户)
curl -i -X POST \ --url http://localhost:8001/consumers/test/key-auth/ \ --data 'key=test'
curl -i -H "apikey: test" -H "Host: example.com" localost