https://github.com/yogeshnishad007/book_library
Deployed Link
https://github.com/yogeshnishad007/book_library
backend booklibrary
Last synced: 2 months ago
JSON representation
Deployed Link
- Host: GitHub
- URL: https://github.com/yogeshnishad007/book_library
- Owner: yogeshnishad007
- Created: 2023-12-02T15:15:15.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-06T08:13:02.000Z (over 1 year ago)
- Last Synced: 2025-02-13T13:26:16.201Z (4 months ago)
- Topics: backend, booklibrary
- Language: JavaScript
- Homepage: https://lovely-moccasins-eel.cyclic.app/
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:**
```bash
git clone https://github.com/your-username/Triluxo-Backend.git
```2. **Navigate to the project directory:**
```bash
cd Triluxo-Backend
```3. **Install dependencies:**
```bash
npm install
```## Usage
### Deployed Link
To access the home page, navigate to [https://lovely-moccasins-eel.cyclic.app/](https://lovely-moccasins-eel.cyclic.app/) in your browser.### API Endpoints
#### Get Books Data
- Retrieve a list of books:
```http
GET /books
```
Example response:
```json
[
{
"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:
```http
POST /post
```
Example request body:
```json
{
"title": "New Book",
"author": "New Author",
"publishedYear": 2023
}
```#### Update a Book
- Update an existing book by ID:
```http
PUT /update/:id
```
Example request body:
```json
{
"title": "Updated Title",
"author": "Updated Author",
"publishedYear": 2023
}
```#### Delete a Book
- Delete a book by ID:
```http
DELETE /delete/:id
```Example response:
```json
{
"message": "Book with ID 1 deleted successfully."
}
```Make sure to run the application locally (http://localhost:4000) to test these endpoints.