A fun and entertaining REST API serving hundreds of Hindi jokes across various popular categories, including Pati-Patni, Teacher-Student, GF-BF, Mazedar, Chutkule, and more!
- Hundreds of Hindi Jokes across multiple categories.
- Built with Node.js and Express.js for fast and scalable performance.
- MongoDB as the database for efficient storage and retrieval of jokes.
- Deployed on Render for free, making it accessible to everyone.
- Easy-to-use API endpoints to fetch random jokes, category-specific jokes, or a specific number of jokes.
- Backend: Node.js, Express.js
- Database: MongoDB (Hosted on MongoDB Atlas)
- Deployment: Render
https://hindi-jokes-api-rm0c.onrender.com
GET /jokes
Response:
{
"_id": "67e94dd4c765f116565e3a97",
"jokeNo": 1,
"category": "Pati-Patni",
"jokeContent": "पति: जानू, मैं तुम्हारे बिना जी नहीं सकता!\nपत्नी: तो मर क्यों नहीं जाते?",
"__v": 0
}
GET /jokes/category/:categoryName
Example:
GET /jokes/category/teacher-student
Response:
[
{
"_id": "67e94dd4c765f116565e3a98",
"jokeNo": 2,
"category": "Teacher-Student",
"jokeContent": "टीचर: परीक्षा में नकल क्यों की?\nस्टूडेंट: ताकि पास होकर आपकी क्लास में ना आना पड़े!",
"__v": 0
}
]
GET /jokes/categories
Response:
[
"Pati-Patni",
"Teacher-Student",
"GF-BF",
"Mazedaar",
"Chutkule",
"और भी बहुत कुछ..."
]
GET /jokes?size=number
Example:
GET /jokes?size=10
Response:
[
{
"_id": "67e94dd4c765f116565e3a99",
"jokeNo": 3,
"category": "Pati-Patni",
"jokeContent": "पति: शादी के पहले तुम मेरी हर बात मानती थी!\nपत्नी: शादी के पहले तुम हर बात ठीक ही तो बोलते थे!",
"__v": 0
},
]
- Node.js installed
- MongoDB Atlas account
- Clone the repository:
git clone https://github.com/vijays376/hindi-jokes-api.git cd hindi-jokes-api
- Install dependencies:
npm install
- Create a
.env
file and add your MongoDB URI:MONGO_URI=mongodb+srv://your-username:your-password@cluster.mongodb.net/hindi-jokes-api
- Start the server:
npm start
- The API will be running at:
http://localhost:5000
We welcome contributions! If you have new jokes or want to improve the API, feel free to submit a pull request.
This project is open-source and available under the MIT License.
Enjoy the funniest Hindi jokes! 😂