From a3af3f3a13bbb8f2a7a2c183acad256ac750d66c Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 23 Jan 2024 15:32:41 +0800 Subject: [PATCH] Deploy behind Kong --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32acb97..afab261 100644 --- a/README.md +++ b/README.md @@ -70,14 +70,23 @@ curl -X POST -H "Content-Type:application/json" \ > export THERESA_EC2_PRIVATE_IP=172.31.10.191 > export KONG_PUBLIC_DNS=ec2-54-177-15-48.us-west-1.compute.amazonaws.com > export SERVICE_NAME=theresa +> export ROUTE_NAME=analyze > > curl -i -s -k -X POST https://${KONG_PUBLIC_DNS}:8444/services \ > --data name=${SERVICE_NAME} \ > --data url="http://${THERESA_EC2_PRIVATE_IP}:8080/invocations" > > curl -i -k -X POST https://${KONG_PUBLIC_DNS}:8444/services/${SERVICE_NAME}/routes \ -> --data 'paths[]=/analyze' \ -> --data name=analyze +> --data 'paths[]=/${ROUTE_NAME}' \ +> --data name=${ROUTE_NAME} +> ``` +> +> Then we can test routing with +> +> ```bash +> curl -k -X POST -H "Content-Type:application/json" \ +> --data '{"dataframe_split": {"columns":["text"], "data":[["我爱中国"], ["米哈游成立于2011年,致力于为用户提供美好的、超出预期的产品与内容。米哈游多年 来秉持技术自主创新,坚持走原创精品之路,围绕原创IP打造了涵盖漫画、动画、游戏、音乐、小说及动漫周边的全产业链。"]]}}' \ +> https://${KONG_PUBLIC_DNS}/${ROUTE_NAME} > ``` ### Topological Sort