# Proxy #

## Services ##

- Geocoding
    - gis.gnome.org/geocode/v1/
        - Proxy to nominatim
    - nominatim.gnome.org
        - Proxy to nominatim
        - Just keep this old proxy path around for old versions of Maps.
    - gis.gnome.org/geocode/v2/
        - Proxy to mapbox geocoding. We want to use this in the future since
          it's much more powerful. 

- Route searches
    - gis.gnome.org/routes/v1/
        - proxy to graphhopper (for route searches)
    - gis.gnome.org/routes/v2/
        - proxy to graphhopper (for route searches)

- Tiles
    - gis.gnome.org/tiles/street/v1/
        - Proxy to Mapbox Streets.
    - gis.gnome.org/tiles/terrain/v1/
        - Proxy to Mapbox Terrain.
    - gis.gnome.org/tiles/satellite/v1/
        - Proxy to Mapbox Satellite.
    - gis.gnome.org/tiles/vector/v1/
        - Proxy to Mapbox Vector.

- Overpass
    - gis.gnome.org/osm-query/v1
        - Proxy to https://overpass-api.de/api/interpreter/

## Rationale ##

We want to proxy up all external services so that we are able to switch when /
if something like the MapQuest situation happens again.

The above covers the services we use or want to use that I know of. I have
intentionally added some extra endpoints for stuff that I know we're interested
in using soonish (like the new routes and geocode endpoints and the terrain and
vector tile sets).

## Open Questions ##

### API keys ###

The API key for GraphHopper is currently embedded in the code, but for the
tilesets I think it makes sense to store them serverside and add them to the
requests if possible. Otherwise if we need to change tilesets again in the
future we'd still need to change API keys in the clients at that time.

### End point versioning ###

I have choosen to postfix all endpoints with v1 and v2 signifying "versions" of
API. This is important to make sure that old clients that works with graphopper
for routing still can connect to its endpoint while a new version of Maps might
use the OSRM service Mapbox is hosting.

I think using version numbers instead of service names to separate the services
makes sense since if Mapbox updates their route search engine api from some
version of OSRM to another we'd still need different endpoints while the
underlying service would be the same.

## TODO ##

1. Get our API key
2. Get the exact endpoints to proxy to
