Skip to content

pkg/api/api.go, pkg/api/gateway.go - update /gateway endpoint with params location, countrycode, or random

sgk requested to merge feat/gatewaysbydistance into main

pkg/api/gateway.go - update GatewayPicker function to address queries with location, countrycode or random location by default pkg/api/api.go - remove the mandatory path parameter location

# sample curl commands 
curl localhost:8443/api/5/gateway/?loc=amsterdam -> returns gateway in amsterdam or msg:`location not supported` if no gateways are there in amserdam

curl localhost:8443/api/5/gateway/?cc=BE -> finds the nearest gateway location and returns one gateway or msg:`CountryCode not supported` 

curl localhost:8443/api/5/gateway -> returns a random gateway

Edited by sgk

Merge request reports

Loading