Peaks is a Meta Display Glasses web app that overlays nearby visible peaks, churches, towers, and tall landmarks relative to the user's position, heading, and altitude.
public/- static frontend for the glasses.functions/api/nearby-peaks.js- Cloudflare Pages Function used by the frontend.GET /api/nearby-peaks?lat={lat}&lng={lng}&alt={alt}- returns visible skyline objects.
npm install
npm run devThen open the local URL printed by Wrangler. The app also has a Demo button that uses the test coordinates near Tanvald.
Use Cloudflare Pages Git integration so every push to main deploys automatically.
- Push this repository to GitHub.
- In Cloudflare Dashboard, open Workers & Pages.
- Select Create application.
- Select Pages.
- Select Connect to Git.
- Pick the GitHub repository for
Peaks. - Configure build settings:
- Framework preset:
None - Production branch:
main - Build command: leave empty, or use
exit 0 - Build output directory:
public - Root directory: leave empty if this repository root contains
public/andfunctions/
- Framework preset:
- Select Save and Deploy.
Cloudflare Pages will also deploy functions/api/nearby-peaks.js because the functions/ directory is at the repository root.
No private API keys are required.
The backend calls:
- OpenStreetMap Overpass for peaks, churches, towers, and height-tagged buildings.
- OpenTopoData SRTM30m for terrain elevation samples.
Because OpenTopoData's public endpoint is rate-limited, the function batches elevation requests with a small delay. For heavier use, replace ELEVATION_URL in functions/api/nearby-peaks.js with a hosted elevation service, Cloudflare Worker, or cached DEM tile pipeline.
npm run checkThis verifies that the Cloudflare Pages Function compiles.