RESTful Hypermedia API that tells you which cloud service/hosting provider a given server's address/name is hosted (e.g. Amazon, CloudFlare, etc.)
Requirements:
- SBT.
Before you start, you should configure some or all of the following environment variables:
Environment Variable | Description |
---|---|
PORT |
Port number for API to host off (defaults 8080 ). |
AWS_IPRANGE_LOCATION |
Required URL for the AWS IP ranges (typically https://ip-ranges.amazonaws.com/ip-ranges.json). |
IS_HOSTED_BY_ASSETS_LOCATION |
Required URL for the HTML assets (e.g. CSS, scripts etc). |
IPRANGES_LOCATION |
Required URL for the general IP ranges (typically https://ip-ranges.is-hosted-by.com/). |
To build and run locally execute:
git clone https://github.com/is-hosted-by/is-hosted-by-api.git
cd is-hosted-by-api
sbt run
To run the unit tests:
sbt test
To run the load tests:
cd load-test
sbt test
To deploy on a Dokku instance execute the following:
git remote add dokku dokku@<ADDRESS>:is-hosted-by-api
git push dokku master
ssh dokku@<ADDRESS> 'config:set is-hosted-by-api AWS_IPRANGE_LOCATION=https://ip-ranges.amazonaws.com/ip-ranges.json'
ssh dokku@<ADDRESS> 'config:set is-hosted-by-api IS_HOSTED_BY_ASSETS_LOCATION=https://is-hosted-by-assets.firebaseapp.com/'
ssh dokku@<ADDRESS> 'config:set is-hosted-by-api IPRANGES_LOCATION=https://ip-ranges.is-hosted-by.com/'
ssh dokku@46.101.18.84 'domains:add is-hosted-by-api is-hosted-by.com'
Where ADDRESS
is the address of hosting your Dokku instance.