Coder Social home page Coder Social logo

intro-mongoose's Introduction

Peer Routing Activity

Fork my intro mongoose repo: https://github.com/mhwalsh/intro-mongoose

Using the Express Routing documentation: http://expressjs.com/en/guide/routing.html

  1. The goal of this step is to refactor the existing code to use multiple routing files. Create a routes folder with two router files new files, one for the 'millie' themed routes (millie.js) and another for general user routes (users.js). Require these routes in the main server file and make sure the server is functioning as it was before. I.e. test all the routes. Commit.
  2. The goal of this step is to add more general routes that will work for any user, not just 'millie'. Again referring to the documentation, create three new general user routes in the users.js file that follow the requirements below. Remember to commit as you go. May be after each new route you create. *Add a route that gets a user by a specific user id and returns that users object. For example if the id in the database is 577509 the URL should look like: http:localhost:3000/577509 *Add an update route that takes a specific user id and a body that contains the field to update. http:localhost:3000/update/577509 or http:localhost:3000/577509 *Add a delete route that takes a specific user id and deletes the user. http:localhost:3000/delete/577509 or http:localhost:3000/577509

Document your API i.e. your new routes. Make sure that it follows restful practices.

Remember you can test these with the REST CLIENT atom package, but you are welcome to add a UI to it.

Once finished submit the repo your partners name.

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.