Galileo is a Cloudflare Worker that provides geolocation data for incoming requests.
-
Clone the repository:
git clone https://github.com/servusdei2018/galileo.git cd galileo
-
Install dependencies:
npm install
To start a local development server:
npm run dev
To deploy the worker to Cloudflare:
npm run deploy
Ensure you've configured your Cloudflare account and namespace in the wrangler.toml
file before deploying.
To run tests:
npm run test
Once deployed, make a GET request to your worker's URL:
curl -X GET https://your-worker.your-domain.workers.dev
The response will be a JSON object containing geolocation data:
{
"ip": "8.8.8.8",
"country": "US",
"region": "California",
"city": "Mountain View",
"latitude": "37.3861",
"longitude": "-122.0839",
"timezone": "America/Los_Angeles",
"asn": 15169,
"isp": "Google LLC"
}
Galileo is distributed under the MIT License. Refer to the LICENSE
file for details.