https://github.com/ashwin-rajeev/location-history-server
https://github.com/ashwin-rajeev/location-history-server
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ashwin-rajeev/location-history-server
- Owner: Ashwin-Rajeev
- Created: 2021-11-25T18:19:18.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-25T18:30:57.000Z (over 4 years ago)
- Last Synced: 2025-01-03T15:45:43.020Z (over 1 year ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Location History Server
toy in-memory location history server.
## Steps to Execute
#### 1. export envs
```bash
export HISTORY_SERVER_LISTEN_ADDR=8080
export LOCATION_HISTORY_TTL_SECONDS=50s
```
#### 2. start the application
```bash
go run main.go
```
### Add Location History [POST]
> http://localhost:8080/location/def457/now
Sample request body
```bash
{
"lat": 19.34,
"lng": 58.78
}
```
Sample response body
```bash
{
"status": "ok",
"result": "success"
}
```
### Get Location History [GET]
> http://localhost:8080/location/def456?max=2
Sample response body
```bash
{
"order_id": "abc123",
"history": [
{"lat": 12.34, "lng": 56.78},
{"lat": 12.34, "lng": 56.79}
]
}
```
### Delete Location History [DELETE]
> http://localhost:8080/location/def457
Sample response body
```bash
{
"status": "ok",
"result": "success"
}
```