Note: It's designed as a debugger tool for package tzf, not production ready.
go install github.com/ringsaturn/tzf-server@latest
# check args
tzf-server --help
# start general server
./tzf-server
# start FuzzyFinder based server
./tzf-server -type 1
http://localhost:8080/web/tzs/all
curl "http://localhost:8080/api/v1/tz?lng=116.3883&lat=39.9289"
Output:
{
"timezone": "Asia/Shanghai"
}
curl "http://localhost:8080/api/v1/tzs?lng=87.6168&lat=43.8254"
Output:
{
"timezones": ["Asia/Shanghai", "Asia/Urumqi"]
}
curl "http://localhost:8080/api/v1/tzs"
Output:
{
"timezones": [
"Africa/Abidjan",
// ...
"Pacific/Tongatapu"
]
}