Get your public IP address in one HTTP request.
APIP is an open source public IP API that focuses on simplicity. It can be really useful if you're looking for a way to get your public IP from command line, script or programs. There is a public server for test purpose : demo-apip.herokuapp.com hosted on a free dynos at heroku.com. If your looking for a more reliable public server for public IP API I recommend you ipify.org.
Requirements :
You must have Golang installed on your server.
Clone the repository :
$ git clone https://github.com/negrel/apip.git $GOPATH/your/path
Run the code for test :
$ cd apip
$ go run .
Build the project :
$ go build
This will build the go code to a binary file named "apip". To launch the server :
$ ./apip
Take a look at the exemple.env file and write your own .env file.
Build the image:
$ make build
# Or without caching
$ make build-nc
Run it:
$ make run
# Or build it then run it
$ make up
To stop & remove the container :
$ make stop
Compile go to binary :
# Build the binary to $BIN_OUTPUT
$ make bin
Clean the binary :
$ make clean
Deploy to heroku :
$ make heroku
Please give a ⭐ if this project helped you!
MIT © Alexandre Negrel