Simple API to fetch random joke
- Node.js version >= 10.3.0
- MySQL Server
Here you can find some installation guides depending on your OS: MySQL Installation Guide
You can find the database used in this project(and their updates) in sqls folder (includes 400 jokes examples for testing)
Install dependencies
- npm install
Set your settings
- Change .env.example to .env
- Change default settings to match your installation
Run locally
- npm run dev
├── package.json
|
├── src # Source code folder
├── index.ts # Main file with dependencies references and project info
├── db.ts # Database (MySQL) connection
├── types.d.ts # Declaration file for types and interfaces
├── routes
├── joke.ts # Routes for /api/joke
├── sqls # Folder with queries for create a database from scratch