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
about this tutorial
A devai.io starter tutorial — your first real backend, and the reason to have one.
More in APIs & Data
view allAPIs & Data
Weather Right Now
Type a city, get the live weather — your first two-step API call.
HTMLCSSJavaScriptfetch()+1
View template zip + preview
APIs & Data
GitHub Profile Card
Type a username, get their profile — your first taste of an API.
HTMLCSSJavaScriptfetch()+1
View template zip + preview
APIs & Data
Random Quote Machine
Load quotes from a data file and show a new one on demand.
HTMLCSSJavaScriptfetch()+1
View template zip + preview