NodeJS Express.js Mongoose MongoDB

Chinese Proverbs API

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

JSON Data Model Example

{
  "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
}

Reference

proverb: Proverb in Mandarin
pinyin: Proverb romanization
translation: Proverb in English


🚀 Quick start

  1. Clone the repository.

    git clone
  2. Install dependencies.

    npm install
  3. Start the development server.

    npm start

Contributions are welcome! 🎉

Deploy to Render