Offers Chinese jokes with description & answer by using an API built on the Express.js framework in Node.js and MongoDB database.
This api is deployed on Heroku. 🚀
BASE_URL = https://quiet-atoll-68130.herokuapp.com
-
Parameters: None
-
Request Body:None
-
Response:
- status: 200 OK
{
"description": "先進船的人會說什麼?"
"answer": "Online,因為仙(先)境(進)傳(船)說 Online。"
}
If you want to expand more interesting Chinese jokes, welcome to submit a Pull Request.
This API only offers Chinese jokes now. If you want it to support jokes of various languages, welcome to create an issue to discuss or submit a Pull Request.
- Clone this project to local
$ git clone https://github.com/winnielinn/joke-api.git
- Change directory and install all dependencies
$ cd joke-api
$ npm install
.env.example
to set environment variables.
PORT=
MONGODB_URI=
Create bulk seed data through this command.
$ npm run seed
Run server on localhost.
If successful, App is listening on port 3000
and MongoDB connection
will show in the terminal.
$ npm run start
If you have installed nodemon, you could use this command.
$ npm run dev
Stop server
Pressing Ctrl + C to stop server running.