Skip to main content
100%

@mourner's suncalc for heroku... moved to https://github.com/RandomEtc/suncalc-api

✓ Published0🌍 Public
RRandomEtc
Last edited Mar 6, 2012
Created on Mar 6, 2012

This example demonstrates a lightweight HTTP API for querying solar calculations, wrapping the SunCalc JavaScript library. It exposes two endpoints—`/times` and `/position`—that accept latitude and longitude parameters, along with an optional date, and return the computed sunrise, sunset, and solar position data. Built with Express 2.5.8, it validates query parameters using custom middleware and supports JSONP callbacks for cross-domain requests. The server runs on Node.js, using the Procfile for Heroku deployment, and serves results as plain JSON responses.

AI-generated description

Similar vizzes