digidem / mapeo-map-server

Offline map style and tile server
MIT License
5 stars 2 forks source link

Detect internet connectivity before making upstream requests #43

Open achou11 opened 2 years ago

achou11 commented 2 years ago

There are certain cases where we make requests to external services/urls to fetch assets (e.g. styles, sprites, glyphs, etc). They should only occur when the device the server is running on has a proper internet connection.

Can use a module like is-online or maybe just use the dns module

achou11 commented 2 years ago

this is a nice-to-have, as the approach of detecting the kind of error thrown by got when an offline request is made has worked well enough for now