Giter Club home page Giter Club logo

koa2's Introduction

koa2

功能

基于nodejs,koa2实现登陆,注册,jwt、上传、crud等接口;

环境

node v16.18.0、koa2、mysql、win11;

使用配置

  1. 修改.env里面的配置文件;
  2. npm install;
  3. 可以将sql文件夹下的sql文件导入到可视化工具里,如Navicat;

功能列表

用户

  • 注册:/users、(POST)
-- body
{
    "username":"githtry",
    "password":123456
}
  • 登陆:/login、(POST)
-- body
{
    "username":"githtry",
    "password":123456
}

动态

  • 发表动态:/moment、(POST)
-- body
{
    "content":"githtry发表了一条动态"
}
  • 查询动态列表:/moment/list?size=${size}&offset=${offset}、(GET)
  • 查询动态详情:/moment/:momentId、(GET)
  • 修改某条动态:/moment/:momentId、(PATCH)
  • 删除某条动态:/moment/:momentId、(DELETE)

评论

  • 发表评论:/comment、(POST)
-- body
{
    "content": "kunkun打球好帅",
    "momentId": 3
}
  • 回复评论:/comment/reply、(POST)
-- body
{
    "content": "确实帅,我家鸽鸽太有实力了",
    "momentId": 3,
    "commentId":6
}

文件

  • 文件上传:/file/avatar2、(POST),form-data(avatar2,file);

koa2's People

Contributors

fsllala avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.