云服务器内容精选

  • 步骤三:本地验证 启动docker容器 docker run -u 1003:1003 -p 8000:8000 custom_container_event_example:latest 打开一个新的命令行窗口,向开放的8000端口发送消息,访问模板代码中指定的/init路径 curl -XPOST -H 'Content-Type: application/json' localhost:8000/init 按照模块代码中返回 Hello init 打开一个新的命令行窗口,向开放的8000端口发送消息,访问模板代码中指定的/invoke路径 curl -XPOST -H 'Content-Type: application/json' -d '{"message":"HelloWorld"}' localhost:8000/invoke 按照模块代码中返回 Hello invoke 在容器启动端口可以看到 Listening on http://localhost:8000 receive {} receive { message: 'HelloWorld' } 或者使用docker logs命令获取容器的日志