taeram / gipsy

Get your public IP address as JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gipsy

Gipsy gives you your public IP address as JSON.

Requirements

You'll need the following:

Setup

Local development setup:

    # Clone the repo
    git clone git@github.com:taeram/gipsy.git
    cd ./gipsy

    # Setup and activate virtualenv
    virtualenv .venv
    source ./.venv/bin/activate

    # Install the pip requirements
    pip install -r requirements.txt

    # Start the application
    python main.py

Docker setup:

    docker run --publish 8080:80 taeram/gipsy:latest

Usage

To get your system's IP address:

curl http://localhost:8080/

Response:

{
    "address": "184.71.226.22"
}

If you're using JSON in a shell script, you might try jq to simplify parsing the JSON.

About

Get your public IP address as JSON

License:MIT License


Languages

Language:Python 77.1%Language:Shell 22.9%