https://github.com/destineeadams/wisdomdisperserapi
https://github.com/destineeadams/wisdomdisperserapi
api api-server apis crud crud-api rest-api
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/destineeadams/wisdomdisperserapi
- Owner: DestineeAdams
- License: mpl-2.0
- Created: 2025-03-30T22:37:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-30T03:27:38.000Z (about 1 year ago)
- Last Synced: 2025-05-19T22:14:45.131Z (about 1 year ago)
- Topics: api, api-server, apis, crud, crud-api, rest-api
- Language: JavaScript
- Homepage: https://wisdomdisperserapi.onrender.com
- Size: 103 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wisdom Dispenser API
Handles creating, updating, and fetching quotes including a random quote endpoint. Perfect for integration into other projects or services.
**See project running here:** https://wisdomdisperserapi.onrender.com ✨
**Related projects:** https://the-wisdom-dispenser.onrender.com
**Tech used:** JavaScript, Node.js, MongoDB, Express, dotenv
## How the Data Is Organized
```json
{
"_id": "",
"quotes": [
"jen was here",
"hello world"
],
"author": "jen",
"rating": {
"$numberInt": "10"
}
}
```
- *Every rating starts out at ten.*
- *Every string entry is transferred to lowercase.*
## HTTP Methods
### `POST`
**Endpoint:** `/api/"quote"/"author"`
- Checks if the quote already exists in the database.
- If it does, the user is pointed to use the `PUT` method instead.
- If not, the quote is added.
### `GET`
**Endpoint:** `/api`
- Returns all data in the database.
**Endpoint:** `/api/random`
- Returns one random document.
### `PUT`
**Endpoint:** `/api/"quote"/"author"`
- Checks if the author exists in the database.
- If so, checks whether the quote already exists.
- If not, adds the quote to the author's quote array.
**Endpoint:** `/api/rate/"quote"/"author"`
- *Coming soon*
### `DELETE`
**Endpoint:** `/api/del/"quote"/"author"`
- *Coming soon*
## Optimizations
- [ ] Implement a system to prevent offensive language from being added to the database.
- [ ] Restructure the schema for scalability and flexibility.