HTTP Method | Endpoint | What it does |
---|---|---|
POST | api/proverbs/ | adds new proverb to database |
GET | api/proverbs/all | returns all proverbs |
GET | api/proverbs/random | returns random proverb |
PUT | api/proverbs/:id | updates proverb |
DELETE | api/proverbs/:id | deletes proverb from database |
Currently supported query string parameters:
Parameter | Description |
---|---|
page | Returns a paginated set. |
limit | The maximum amount of proverbs to be returned. |
Example:
📃 First page showing 10 proverbs
https://chinese-proverbs.onrender.com/api/proverbs?page=1&limit=10
{
"proverb": "难得糊涂。",
"pinyin": "Nán dé hú tu",
"translation": "Ignorance is bliss.",
"_id": "63e69b9d10b169bf8d7ee994",
"createdAt": "2023-02-10T19:31:41.995Z",
"updatedAt": "2023-02-10T19:31:41.995Z",
"__v": 0
}
proverb
: Proverb in Mandarin
pinyin
: Proverb romanization
translation
: Proverb in English
-
Clone the repository.
git clone
-
Install dependencies.
npm install
-
Start the development server.
npm start