Giter Site home page Giter Site logo

202-nodejs-web-paper's Introduction

基于 express + mongoose 的api 练习(2)

运行方式

  1. 检查 config/default.json 中参数配置是否正确

  2. 在命令行中执行如下命令

    npm start
  3. 在浏览器中测试 http://localhost:3000

  4. 在浏览器中测试 http://localhost:3000/homeworks

练习要求

重要:本题包含四个篇目:基础,进阶,做完一个篇目后,需要到 https://jinshuju.net/f/27Zpwx 提交做题记录

基础篇

  1. 创建model: homework 完成下列接口

    GET /homeworks  # 获取全部 homework
    GET /homeworks/:id	  # 获取一个 homework
    POST /homeworks   #增加一个 homework
    DELETE /homeworks/:id  # 删除一个 homework
    PUT /homeworks/:id	 # 更新一个 homework
    
  2. 创建Model: section,section 与 homework 为多对多关系,并参照上面完成相应接口

  3. 创建Model: paper,paper 与 section 为一对多关系,并参照上面完成相应接口

进阶篇

  1. 自己编写刷数据库脚本创建上述数据库,并完成功能
  2. 用 supertest + mocha 完成上述接口的集成测试
  3. 用 inspector 调试功能解决问题

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.