Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.21 KB

README.md

File metadata and controls

55 lines (35 loc) · 1.21 KB

APOD Proxy

Node application that proxies requests to NASA's Astronomy Picture Of the Day API and caches responses using Redis.

Setup

An API key for api.nasa.gov is required. A key can be generated in about 5 seconds at: https://api.nasa.gov/#signUp

Redis is running inside docker.

Run

Start up redis using docker-compose:

docker-compose up

To run the server on port 3000:

NASA_API_KEY=<nasa-api-key-here> npm start

Use

Hit the root endpoint with or without a date. Any request made with a date will have its response cached for 60 minutes.

curl https://localhost:3000/?date=2019-10-28

Deploy

To deploy to PCF, the following must be setup:

Deploy via:

./deploy.sh

Additionally, you can monitor the deploy using:

./monitor.sh

This is useful to make sure zero-downtime deployments are working as expected.