Code Monkey home page Code Monkey logo

heroku-datapeace-assignment's Introduction

heroku-datapeace-assignment

Technologies used

End points

  • /api/test/multipleUsers - POST - To add multiple users

    1. Post request must send data in json format to populate db
    2. Response with HTTP status code 201 on success {}
  • /api/test/multipleUsers - DELETE - To delete all users in db

  • /api/users - GET - To list the users.

    1. Response with HTTP status code 200 on success.
    2. Also, supports some query parameters:-
    3. page - a number for pagination
    4. limit - no. of items to be returned, default limit is 5
    5. name - search user by name as a substring in First Name or Last Name (Note, use substring matching algorithm/pattern to match the name)
    6. Sort - name of attribute, the items to be sorted. By default it returns items in ascending order if this parameter exist, and if the value of parameter is prefixed with โ€˜-โ€™ character, then it should return items in descending order.
    7. Sample query endpoint:- /api/users?page=1&limit=10&name=James&sort=-age. This endpoint should return list of 10 users whose first name or last name contains substring given name and sort the users by age in descending order of page 1.
  • /api/users - POST - To create a new user

    1. Request Payload should be like in json format :-
    2. Response with HTTP status code 201 on success and {}
    3. This endpoint will create a new user inside the database
  • /api/users/{id} - GET - To get the details of a user

    1. Here {id} will be the id of the user in path parameter
    2. Response with HTTP status code 200 on success
    3. Sample query looks like:- /api/users/1 of GET type
  • /api/users/{id} - PUT - To update the details of a user

    1. Here {id} will be the id of the user in path parameter
    2. Request Payload should be like in json format for updating first name, last name and age:-
    3. Response with HTTP status code 200 on success and {}
  • /api/users/{id} - DELETE - To delete the user

    1. Here {id} will be the id of the user in path parameter
    2. Response with HTTP status code 200 on success {}

heroku-datapeace-assignment's People

Contributors

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