Coder Social home page Coder Social logo

assignment's Introduction

How to get Started Locally

- Clone the Repo in your Working Directory.
- Make sure Node is installed in your system.
- Make sure MongoDB Community Server is installed in your system and Running.
- Run : 
    ```npm install```
     ```npm start```

Books Endpoints

Note: All data should be sent in JSON.

- Create a Book
    - Path : /api/v1/books
    - Method : POST
    - Request Body : {
        "title" : "Book-1",
        "author" : "Tushar",
        "genre" : "Fiction",
        "pubYear" : 2001
    }
    Note : All fields are Necessary.
    - Response Body : 
        - On_Success : {
            data: created_book_data,
            success: true,
            message: 'Successfully created the Book',
            err: {}
        }
        - On_Error : {
            data: {},
            success: false,
            message: "Message_Here",
            err: "Explanation_of_Error_Here"
        }

- Get all Books
    - Path : /api/v1/books
    - Method : GET
    - Request Body : {
        // Nothing To Pass Here
    }
    - Response Body : 
        - On_Success : {
            data: [{Book_1}, {Book_2},...],
            success: true,
            message: 'Successfully fetched all the Books.',
            err: {}
        }
        - On_Error : {
            data: {},
            success: false,
            message: "Message_Here",
            err: "Explanation_of_Error_Here"
        }

- Get a Single Book
    - Path : /api/v1/books/{Book_id_here}
    - Method : GET
    - Request Body : {
        // Nothing To Pass Here
    }
    - Response Body : 
        - On_Success : {
            data: Book_Details,
            success: true,
            message: 'Successfully fetched the Book.',
            err: {}
        }
        - On_Error : {
            data: {},
            success: false,
            message: "Message_Here",
            err: "Explanation_of_Error_Here"
        }

- Update a Book
    - Path : /api/v1/books/{Book_id_here}
    - Method : PUT
    - Request Body : {
        "field_name" : "Value_here"
    }
    Note : Can put multiple fields here.
    - Response Body :
        - On_Success : {
            data: Updated_Book_Details,
            success: true,
            message: 'Successfully Updated the Book.',
            err: {}
        }
        - On_Error : {
            data: {},
            success: false,
            message: "Message_Here",
            err: "Explanation_of_Error_Here"
        }

- Delete a Book
    - Path : /api/v1/books/{Book_id_here}
    - Method : DELETE
    - Request Body : {
        // Nothing To Pass Here
    }
    - Response Body : 
        - On_Success : {
            data: true,
            success: true,
            message: 'Successfully deleted the Book.',
            err: {}
        }
        - On_Error : {
            data: {},
            success: false,
            message: "Message_Here",
            err: "Explanation_of_Error_Here"
        }

assignment's People

Contributors

tushar-hack 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.