Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

其他文件干嘛用的? #25

Closed
salyang opened this issue Jan 26, 2013 · 1 comment
Closed

其他文件干嘛用的? #25

salyang opened this issue Jan 26, 2013 · 1 comment

Comments

@salyang
Copy link

salyang commented Jan 26, 2013

已经成功在本地与appfog上配置,并且微信可以使用。
不过只用到了examples文件夹内的app.js rules.js support.js
外面的一些文件,比如index.js引用的lib文件夹下是用来干嘛的?
能举例说明下其他文件干嘛用的吗?

@atian25
Copy link
Member

atian25 commented Jan 26, 2013

  1. 如果要发布,应该是只发布example目录,具体作法是:
  • cd example
  • npm install ../ 或 npm install weixin-robot  前者是我们类库开发者用的, 后者是用于安装我们发布到npm服务器的类库.
  • npm install 安装其他依赖。

2.对于你自己的项目, 那就应该只拷贝example目录, 然后改为你自己的名字, 然后随便DIY

3.lib目录里面就是类库的对应内容了。

  • webot 为主类,开发者主要是用这个类
  • info 为微信消息结构体的封装
  • action 为路由规则的定义和逻辑
  • middlewares 为express中会用到的route, 一般不直接用该类, 它已经被webot代理了。
  • utils 为辅助类

4.你可能需要了解的相关知识:

  • nodejs的模块机制
  • npm install
  • require

@atian25 atian25 closed this as completed Jan 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants