Giter VIP home page Giter VIP logo

restful_tasks_crud_mean_ex's Introduction

Restful Task API

Using your new knowledge of 'Restful Routing', create an application with endpoints (routing rules) which offer CRUD operations for 'tasks'. We should be able to use this API for the following commands:

  • GET: Retrieve all Tasks
  • GET: Retrieve a Task by ID
  • POST: Create a Task
  • PUT: Update a Task by ID
  • DELETE: Delete a Task by ID

The tasks should be responded in a json format. Consider the tasks being objects with the following properties:

  • _id: (string) (default id generated by mongoDB)
  • title: (string)
  • description: (string, default to empty string)
  • completed: (boolean, default to: false)
  • created_at: (date, default to current date)
  • updated_at: (date, default to current date)

Once your API is complete and your routing rules are in place, and follow the 'restful routing' standards, use the 'postman' browser extension to test your routing rules. 'Postman' is a simple (and quite popular) browser extension that allows you to prepare your own HTTP requests, serving as an ideal tool for testing your server's API.

Using Postman:

  1. When you open Postman, click on 'Collection' to create a new set of routes for a particular project. For this assignment, name your collection 'Task API'.
  2. In the sidebar, you will see a list of your collections. If you just created your first collection, that will be the only one you see, and it will not have any requests yet. Let's make some requests!
  3. To the left, you'll see a dropdown to choose the kind of request you would like to make. You also have an input field to type the route for your request. If you have your Restful Task API assignment running, you may make a get request to localhost:8000/tasks. Click Send and see the response from your API below.
  4. To make a post request, change the request type to post and type in the route. To provide the post data, click on body, select the raw radio button, and choose JSON (application/json). Create the object you would like to send to the server. Make sure your key-value pairs match what your server is expecting! Click Send to see your server's response.
  5. Hopefully you have your server set up to respond and let you know whether your post was successful or not!
  6. To save a request to your collection, just choose the Save As option from the Save button. You will be prompted to select the collection where you would like to save the request. This can be very useful when working in a group, because then the backend developer can create a collection of routes and share it with the frontend developer.

restful_tasks_crud_mean_ex's People

Contributors

johandrog 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.