A web app for browsing NASA's Astronomy Picture of the Day across any date range, powered by NASA's official Open API. A lightweight Express backend keeps the API key private and caches responses.
- Frontend: HTML, CSS, vanilla JavaScript (ES6)
- Backend: Node.js + Express
- Data: NASA APOD Open API (https://api.nasa.gov/)
Prerequisites: Node.js v18+ and a free NASA API key from https://api.nasa.gov/
git clone https://github.com/canyang25/NASA-apod-service.git
cd NASA-apod-service
npm install
cp .env.example .env # then paste your NASA key into .env
npm startOpen http://localhost:3000 in your browser.
Note: confirm the start command and port match your server.js / package.json.
Create a .env file in the project root:
NASA_API_KEY=your_key_here
PORT=3000Never commit your real .env — keep it in .gitignore and commit a .env.example with placeholder values instead.
- Handle video APOD entries (some days are YouTube/Vimeo, not images)
- Loading and error states for slow or failed requests
- Paginate long date ranges
- Deploy a live demo
Imagery and data from NASA's Astronomy Picture of the Day (https://apod.nasa.gov/apod/) via the NASA Open APIs.