token设置&nginx反向代理

$ sudo /etc/init.d/nginx start #启动nginx
$ sudo rm /etc/nginx/sites-enabled/default #删除默认配置
$ sudo touch /etc/nginx/sites-available/wechat_connector#建立项目文件
$ sudo ln -s /etc/nginx/sites-available/wechat_connector/etc/nginx/sites-enabled/wechat_connector #设置软链接
$ sudo vim /etc/nginx/sites-enabled/wechat_connector #编辑项目文件

添加:

server { 
    server_name 公网ip;
    listen 80;
    location /weixin { 
        proxy_pass http://127.0.0.1:8000;
    }
}

最简单的hello world

import werobot
robot = werobot.WeRoBot(token='tokenhere')
# 消息处理函数
@robot.handler
def echo(message): 
    return 'Hello World!'

robot.run(server="gunicorn", port=8000)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,755评论 19 139
  • 原文链接:http://www.dropwizard.io/1.2.0/docs/getting-started....
    Lance_Xu阅读 4,620评论 0 0
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,799评论 25 709
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,101评论 6 342
  • 为什么会看见她为什么这么巧为什么会遇到她为什么……不停的问自己!这么久以来,难道是上天激励我继续触动起疼痛转化为努...
    我叫小鱼儿阅读 1,267评论 0 0