This is a practice demo for learning new technology stack.
这个练习的预计总花费时间约为4个小时.
- 简单了解JavaScript中的变量、函数、循环与条件控制语法
- Git
- GitHub使用流程
- Gitflow 的具体使用方法与原理可以参考这个链接,在观看的过程中请跳过使用
git-flow extensions的相关内容。我们本次提交时使用的BRANCHNAME为demo-<Your GitHub user name>
- Express
- 请完成官方网站中红框圈出部分的阅读
使用npm install和npm run运行整个项目
而在这个demo中你需要满足的要求是:
- GET /
- Response Example: 'This is a GET API'
- POST /
- Response Example: 'This is a POST API'
- PUT /
- Response Example: 'This is a PUT API'
- DELETE /
- Response Example: 'This is a DELETE API'
- 请只使用一次router调用完成上述效果 提示链接
- POST /user/:id
- Description: 如果id为
12345返回User id is correct否则返回User id is wrong - Response Example:
- POST /user/12345
- 'User id is correct'
- POST /user/11111
- 'User id is wrong'
- POST /user/12345
- 请使用middleware达成此效果 提示链接
- Description: 如果id为
- GET /addFive/:num
- 请经常使用
npm test命令查看代码是否可以通过测试满足要求 - 代码需要符合Google style规范,可以使用
npx eslint .命令检查是否符合规范