Get Docker
OS support: Mac, Windows, Linux
start an APISIX container with stand-alone mode by the following command:
docker run -d --name apache-apisix \
-p 9080:9080 \
-e APISIX_STAND_ALONE=true \
apache/apisix
Add Route and Plugin configuration to the running APISIX container:
docker exec -i apache-apisix sh -c 'cat > /usr/local/apisix/conf/apisix.yaml <<_EOC_
routes:
-
id: httpbin
uri: /*
upstream:
nodes:
"httpbin.org": 1
type: roundrobin
plugin_config_id: 1
plugin_configs:
-
id: 1
plugins:
response-rewrite:
body: "Hello APISIX\n"
desc: "response-rewrite"
#END
_EOC_'
Test:
curl http://127.0.0.1:9080/
有回傳Hello APISIX\n
即代表Build up成功。