This is a sample project that demonstrates using simple RESTful API for managing quotes. It allows users to create, read, update, and delete quotes, as well as retrieve a random quote.
- Get all quotes
- Create a new quote
- Get a specific quote by ID
- Update an existing quote
- Delete a quote
- Get a random quote
- Node.js
- Express.js
- MongoDB
- log4js (for logging)
- Clone the repository
- Install dependencies:
npm install
- Make sure MongoDB is installed and running on your local machine
- Start the service:
node index.js
The server will start running on http://localhost:6666
.
GET /quotes
- Get all quotesPOST /quotes/new
- Create a new quoteGET /quotes/get/:id
- Get a specific quote by IDDELETE /quotes/delete/:id
- Delete a quotePATCH /quotes/update/:id
- Update a quoteGET /quotes/random
- Get a random quote
This application uses log4js for logging. Logs are stored in /api/api.log
.