Skip to content

yogeshnishad007/Book_Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Triluxo Backend

Welcome to the backend application for Triluxo! This Express.js application interacts with a MongoDB database to manage books.

Getting Started

Prerequisites

  • Node.js installed
  • MongoDB installed and running

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/Triluxo-Backend.git
  2. Navigate to the project directory:

    cd Triluxo-Backend
  3. Install dependencies:

    npm install

Usage

Deployed Link

To access the home page, navigate to https://lovely-moccasins-eel.cyclic.app/ in your browser.

API Endpoints

Get Books Data

  • Retrieve a list of books:
    GET /books
    Example response:
    [
        {
            "id": 1,
            "title": "Sample Book 1",
            "author": "Author 1",
            "publishedYear": 2022
        },
        {
            "id": 2,
            "title": "Sample Book 2",
            "author": "Author 2",
            "publishedYear": 2023
        }
    ]

Add a New Book

  • Add a new book to the database:
    POST /post
    Example request body:
    {
        "title": "New Book",
        "author": "New Author",
        "publishedYear": 2023
    }

Update a Book

  • Update an existing book by ID:
    PUT /update/:id
    Example request body:
    {
        "title": "Updated Title",
        "author": "Updated Author",
        "publishedYear": 2023
    }

Delete a Book

  • Delete a book by ID:

    DELETE /delete/:id

    Example response:

    {
        "message": "Book with ID 1 deleted successfully."
    }

Make sure to run the application locally (http://localhost:4000) to test these endpoints.

Releases

No releases published

Packages

No packages published