https://github.com/saumya-shrestha/joke-api
Joke-API is a simple RESTful API to display jokes. It supports CRUD operations for jokes and allows filtering by joke type.
https://github.com/saumya-shrestha/joke-api
expressjs nodejs rest-api
Last synced: 2 months ago
JSON representation
Joke-API is a simple RESTful API to display jokes. It supports CRUD operations for jokes and allows filtering by joke type.
- Host: GitHub
- URL: https://github.com/saumya-shrestha/joke-api
- Owner: Saumya-Shrestha
- License: mit
- Created: 2025-03-13T04:48:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-25T02:36:46.000Z (over 1 year ago)
- Last Synced: 2025-04-01T11:49:39.762Z (about 1 year ago)
- Topics: expressjs, nodejs, rest-api
- Language: JavaScript
- Homepage:
- Size: 847 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Joke-API
Joke-API is a simple RESTful API built with Node.js and Express to deliver joy to the world through jokes. It supports CRUD operations for jokes and allows filtering by joke type.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/Joke-API.git
cd Joke-API
```
2. Install the dependencies:
```bash
npm install
```
3. Start the server:
```bash
node index.js
```
4. The API will be available at http://localhost:3000.
## Usage
| Method | Endpoint | Description |
| -------- | --------------- | ------------------------------------ |
| `GET` | `/random` | Get a random joke. |
| `GET` | `/jokes/:id` | Get a specific joke by ID. |
| `GET` | `/filter?type=` | Filter jokes by type. |
| `POST` | `/jokes` | Add a new joke. |
| `PUT` | `/jokes/:id` | Replace a joke by ID. |
| `PATCH` | `/jokes/:id` | Edit a joke by ID. |
| `DELETE` | `/jokes/:id` | Delete a specific joke by ID. |
| `DELETE` | `/all` | Delete all jokes (requires API key). |
## Demo

## License
This project is licensed under the MIT License.