Skip to content

feat: Create a route to fetch book details by its Id #4

@MahendraDani

Description

@MahendraDani

Description

Create an API endpoint to fetch details of a book by its isbn Id.

Difficulty

  • Intermediate
  • 30 Points

API Endpoint

POST http://localhost:3000/books/:id

Controller

/controllers/books/getBookById.js

Request Params

"id" : "9781593279509"

Response

{status : 200,
message : "Book fetched successfully"
book : {
            "isbn":"9781593279509",
            "title":"Eloquent JavaScript, Third Edition",
            "subtitle":"A Modern Introduction to Programming",
            "author":"Marijn Haverbeke",
            "published":"2018-12-04T00:00:00.000Z",
            "publisher":"No Starch Press",
            "pages":472,
            "description":"JavaScript lies at the heart of almost every modern web application, from social apps like Twitter to browser-based game frameworks like Phaser and Babylon. Though simple for beginners to pick up and play with, JavaScript is a flexible, complex language that you can use to build full-scale applications.",
            "website":"http://eloquentjavascript.net/"
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions