1 Star 0 Fork 0

李鼎 / koa-restfulapi-zhihu

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Node.js仿知乎服务端

[postman] https://gitee.com/li_ding/koa-restfulapi-zhihu/blob/master/postman.jpg

[启动] https://gitee.com/li_ding/koa-restfulapi-zhihu/blob/master/%E5%90%AF%E5%8A%A8.png

1-用户功能开发

  • 根据page查找find用户列表
  • 通过id查找特定用户findById,在用select选择特定的用户信息
  • 实现增加用户的功能,同时实现用户已占用的逻辑
  • 实现用户的鉴权checkOwner中间件
  • 实现用户的更新update
  • 实现用户的删除delete以及用户不存在逻辑的处理
  • 实现用户的登录功能login,同时使用jsonwebtoken做权限认证,使用系统变量将用户信息存到ctx.user.state中
  • 实现用户的关注功能
  • 实现用户的粉丝功能
  • 实现用户的关注话题功能
  • 实现用户赞答案
  • 实现用户踩答案
  • 实现用户的Schema设计,与关注的人多对多关系

2-话题功能开发

  • 查找话题列表
  • 根据id查找话题
  • 创建话题
  • 更新话题
  • 实现话题的Schema设计,与问题的多对多关系

3-问题功能开发

  • 查找问题列表
  • 根据id查找问题
  • 创建问题
  • 更新问题
  • 实现问题的Schema设计,与话题的多对多关系

4-route模块开发

5-mongodb数据库连接

项目执行

1、将项目克隆到本地,cd到react-jianshu

https://github.com/Monster880/koa-restfulapi-zhihu1.git
cd koa-restfulapi-zhihu1

2、安装依赖

npm install  yarn install

3、执行

npm run dev  yarn dev
// (开发环境)

以上是参考了Lewis老师的课程制作,并修改了相关的bug

MIT License Copyright (c) 2020 李鼎 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

koa-restfulapi-zhihu 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/li_ding/koa-restfulapi-zhihu.git
git@gitee.com:li_ding/koa-restfulapi-zhihu.git
li_ding
koa-restfulapi-zhihu
koa-restfulapi-zhihu
master

搜索帮助