a simple api that returns random quotes from famous authors
GET /api/quotes{
"quotes": [
{
"author": "string",
"quote": "string",
"id": "number"
}
]
}- NodeJS
- NPM
- Docker (Optional)
- Docker compose (Optional)
Install dependencies
npm installRun app on localhost:8000
npm startBuild image
docker build -t pbgnz/random-quote-api .Run image
docker run -d -p 8000:8000 pbgnz/random-quote-apiPull the latest image from Dockerhub
docker pull pbgnz/random-quote-api:1.5.2Run image
docker run -p 8000:8000 -d pbgnz/random-quote-api:1.5.2Fetch endpoint
GET http://localhost:8000/api/quotesAdd the image to your docker-compose.yaml file
# example
version: '3'
services:
api:
image: 'pbgnz/random-quote-api:1.5.2'
ports:
- '8000:8000'