Skip to content

This repository contains a Node.js application for managing a book library. It uses Express.js for the server, CORS for cross-origin requests, and connects to a Replit database. The app supports CRUD operations, including retrieving a list of books via a GET request to the `/api/books` endpoint.

Notifications You must be signed in to change notification settings

CynthiaWahome/node-book-library-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Book Library Management System

This repository contains a Node.js application for managing a book library. It uses Express.js for the server, CORS for cross-origin requests, and connects to a Replit database. The app supports CRUD operations, including retrieving a list of books via a GET request to the /api/books endpoint.

Features

  • Express.js Server: Handles HTTP requests and responses.
  • CORS: Enables cross-origin requests.
  • Replit Database: Stores book data.
  • CRUD Operations: Create, Read, Update, and Delete books.

Endpoints

Get All Books

  • URL: /api/books
  • Method: GET
  • Description: Retrieves a list of all books in the library.
  • Response:
    • 200 OK: Returns an array of books.
    • 500 Internal Server Error: Returns an error message if the books cannot be retrieved.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/book-library.git
    cd book-library
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    • Create a .env file in the root directory.
    • Add your Replit database URL and other necessary environment variables.
  4. Start the server:

    npm start

Usage

  • Access the API at http://localhost:3000/api/books to retrieve the list of books.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Documentation

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

This repository contains a Node.js application for managing a book library. It uses Express.js for the server, CORS for cross-origin requests, and connects to a Replit database. The app supports CRUD operations, including retrieving a list of books via a GET request to the `/api/books` endpoint.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published