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 install
Run app on localhost:8000
npm start
Build image
docker build -t pbgnz/random-quote-api .
Run image
docker run -d -p 8000:8000 pbgnz/random-quote-api
Pull the latest image from Dockerhub
docker pull pbgnz/random-quote-api:1.5.2
Run image
docker run -p 8000:8000 -d pbgnz/random-quote-api:1.5.2
Fetch endpoint
GET http://localhost:8000/api/quotes
Add the image to your docker-compose.yaml file
# example
version: '3'
services:
api:
image: 'pbgnz/random-quote-api:1.5.2'
ports:
- '8000:8000'