1.0.4 • Published 6 years ago

@sevenryze/deploy v1.0.4

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
6 years ago

目录

The Deep Digest App Backend Controller

This is project App of DeepDigest Inc. for simplifying the backend server development.

Our server group guys have made lots of discussions about which tools we should adopt, and we choose node.js, the baby but powerful platform. Then we talked about pure js, traceur, babel and so on. Finally, we made a united decision on that it must be typescript - microsoft's typed javascript.

This server framework is aimed at the goal - "simple, fast, debug-faced and stable". It's used for holding the big application logic level layer of our backend system. For now we have done many awesome features like tasks switch, debug information info and request-response object initialize. In the future, we will try our best to get continual improvements. Good luck for this team!

Build

Use the typescript compiler to compile the code set. For more information, you should check the tsconfig.ts file.

测试

We use a well-known combination set - jest and superagent. You are to use npm test script to test all the code, like:

npm test

部署

安装nodejs

  1. 安装nvm: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
  2. 重新进入shell.
  3. 使用command -v nvm确认nvm安装成功.
  4. 使用nvm install node或者nvm install node --lts安装node.
  5. 使用npm install -g npm升级npm.

安装pm2

  1. 使用npm install -g pm2安装pm2.
  2. 使用pm2 install pm2-logrotate安装log rotate工具.

上传代码至服务器

  1. 将需要上传的服务器文件打包.
  2. 上传之后解压缩.

运行

  1. 分别进入不同的工程目录, 使用pm2 start app或者pm2 start admin启动应用.

注意:

为了保持API兼容性,我们采取以下策略: 1. 借用SemVer的概念,对API版本,我们使用major.minor.patch这种方式标识API版本。 1. 从REST URI上我们只能看到公开的major版本,例如:/api/1/user/gogo。内部完整版本请参考package.json。 1. 一个REST API的URI和返回值组成一个最小二元组,任何一个元素发生变化都表示版本发生变化。例如:URI不变而返回值发生变化,我们也认为其API版本发生变化。 1. major版本代表API发生了重大变化以至于必须打破向后兼容性。此时我们将会改变URI中的API版本字符串,而REST返回值等也将发生相应变化。 1. minor版本代表API发生了扩增,以前的API保持兼容。此时我们采用增加API URI或扩增返回值的方式来扩增功能,这样,新的功能可以使用新的URI、新的返回值字段,而旧的功能继续使用旧的API。 1. patch版本代表API没有发生变化,全部保持兼容性。此时我们只是对功能做了一定的修补,但保持所有的URI和返回值均不发生变化。

TODO

  1. 模拟明星或组织, 与用户进行交流.

Code of Conduct

  1. You are not rambo. Remember that we are a team.
  2. Please invite someone to review your code, again, you are not immortal.
  3. Never blame any workmate for the quality of code set, you should know that boss already fined the poor guy.

Contributor

  • Jason - XmT Inc.
  • Cris - XmT Inc.
  • Becky - XmT Inc.
  • Rangeragent - XmT Inc.