https://github.com/gh-aam/book-listing-server
A simple book listing server built with Express.js.
https://github.com/gh-aam/book-listing-server
express express-js express-middleware expressjs javascript javascript-applications javascript-es6 javascript-framework
Last synced: about 2 months ago
JSON representation
A simple book listing server built with Express.js.
- Host: GitHub
- URL: https://github.com/gh-aam/book-listing-server
- Owner: gh-aam
- Created: 2025-05-16T07:22:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-22T12:45:53.000Z (about 1 year ago)
- Last Synced: 2025-05-24T00:13:52.532Z (about 1 year ago)
- Topics: express, express-js, express-middleware, expressjs, javascript, javascript-applications, javascript-es6, javascript-framework
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# book-listing-server
A simple Express.js server that provides a list of nature-themed books with support for search and detailed views.
## Features
* Request logging middleware
* Home route
* Book list route which returns a list of all books
* Book search route which searches for books by title
* Book details route which fetches book details by ID
* Error handling middleware for unknown routes
## Installation
```bash
git clone https://github.com/gh-aam/book-listing-server.git
```
```bash
cd book-listing-server
```
```bash
npm install
```
## Usage
Start the server:
```bash
npm start
```
Or during development with hot-reload:
```bash
npm run dev
```
Once the server is running, visit:
* [http://localhost:3000](http://localhost:3000) - Home page
* [http://localhost:3000/books](http://localhost:3000/books) - Book list
* [http://localhost:3000/books/search?title=wild](http://localhost:3000/books/search?title=wild) - Book search by title
* [http://localhost:3000/books/3](http://localhost:3000/books/3) - Book details by ID
## Example Response
`GET /books/3`
```json
{
"id": 3,
"title": "The Overstory",
"author": "Richard Powers"
}
```
## Scripts
* `npm start` - Start the server
* `npm run dev` - Start the server with `nodemon`