Hostedby is a simple (REST API) written in GoLang that takes an IP address in string format and searches for it in a SQLite database. If it finds the IP Address in the database it will return a json response. The example response shows an AWS IP address having been found in the database.
{
"Net":"52.93.153.170/32",
"Start_ip":878549418,
"End_ip":878549418,
"Url":"https://ip-ranges.amazonaws.com/ip-ranges.json",
"Cloudplatform":"aws",
"Iptype":"IPv4",
"Error":"None"
}
- Golang
- SQLite
The following instructions list how to install the API locally using docker and docker-compose.
- Install [Docker] (https://docs.docker.com/get-docker/)
- Install [Docker-compose] (https://docs.docker.com/compose/install/)
- Using a shell cli clone the repo
git clone https://github.com/stclaird/hostedby.git
- Run Docker-compose
cd hostedby docker-compose up
- Test the API - curl example shown, although a web browser or postman should work also.
curl "http://localhost:8080/findip?ip=52.93.153.170"
Distributed under the MIT License. See LICENSE.txt
for more information.