Skip to content

Latest commit

 

History

History
56 lines (51 loc) · 1.46 KB

README.md

File metadata and controls

56 lines (51 loc) · 1.46 KB

whatsmyip

Golang API running as a Vercel Serverless Function which returns your public IP address

Links

  • Homepage
  • API - supports the following accept headers:
    • application/json
    • application/protobuf
    • defaults to text/plain

Prerequisites

Setup

# Clone the repo and enter directory
git clone [email protected]:wafer-bw/whatsmyip.git
cd whatsmyip
# Get Vercel and login
npm i -g vercel
vercel login
# Link project to your vercel account
vercel

Usage

If you don't have make, you can just run the commands found in the Makefile directly

# Run the webpage & API
make run
# Run tests & benchmarks
make test
# Run the API only
make api
# Update coverage badge
make coverage
# Update protobuf API contract
make protoc
# Run benchmarks
make benchmark
# Run formatting
make format
# Run linting
make lint

If you have issues with make protoc:

go get github.com/golang/protobuf/protoc-gen-go
export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:/usr/local/go/bin