Skip to content

RESTful Hypermedia API to find what provider a server is hosted on.

License

Notifications You must be signed in to change notification settings

rgladwell/is-hosted-by-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Is Hosted By API Build Status Codacy Badge

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:

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/).

Building

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

Testing

To run the unit tests:

sbt test

To run the load tests:

cd load-test
sbt test

Deployment

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.

About

RESTful Hypermedia API to find what provider a server is hosted on.

Resources

License

Stars

Watchers

Forks

Packages

No packages published