https://github.com/bmmunga/location-web-server
This simple web server uses an in-memory data store and exposes an API endpoint that responds to GET requests.
https://github.com/bmmunga/location-web-server
golang json restful-api webserver
Last synced: 2 months ago
JSON representation
This simple web server uses an in-memory data store and exposes an API endpoint that responds to GET requests.
- Host: GitHub
- URL: https://github.com/bmmunga/location-web-server
- Owner: bmmunga
- Created: 2024-07-01T07:15:51.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-02T13:27:35.000Z (11 months ago)
- Last Synced: 2025-03-11T23:33:06.831Z (3 months ago)
- Topics: golang, json, restful-api, webserver
- Language: Go
- Homepage: https://location-web-server-production.up.railway.app/api/hello?visitor_name=
- Size: 4.51 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Location Web Server
Location-web-server is a simple web server that provides weather information and personalized greetings based on the client's IP address and location.
## Features
- Fetches client's IP address and geolocation.
- Retrieves current weather data for the client's location.
- Caches geolocation and weather data to reduce API calls.
- Exposes an API endpoint for personalized greetings.## API Endpoint
### GET `/api/hello`
#### Query Parameters:
- `visitor_name` (optional): The name of the visitor (default: "Guest").#### Response:
```json
{
"client_ip": "127.0.0.1",
"location": "New York",
"greeting": "Hello, Mark!, the temperature is 11 degrees Celsius in New York"
}