all templates
APIs & Data

NASA Photo of the Day

The same fetch idea — but now with a real backend hiding the API key.

Show NASA's picture of the day, fetched through your own tiny Node server. This is the tutorial where you learn why apps have backends: to hold secrets. The key stays on the server and never reaches the browser.

What's inside

  • A complete Node backend with zero npm packages
  • Serves the page and proxies the API in one file
  • The API key lives in .env, never in the browser
  • The proxy pattern, drawn out and explained
  • Runs with a single `node server.js`

Quickstart

$ curl -LO https://devai.io/downloads/nasa-photo-proxy.zip$ unzip nasa-photo-proxy.zip && cd nasa-photo-proxy$ cp .env.example .env   # optional: add your own key$ node server.js   # then open http://localhost:3000

Browse the code

The full source, exactly as the zip ships it.

loading…
Download .zip
loading tree…

about this tutorial

A devai.io starter tutorial — your first real backend, and the reason to have one.