Skip to content

Golang API deployed as a Vercel Serverless Function that returns your public IP address.

License

Notifications You must be signed in to change notification settings

wafer-bw/whatsmyip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Golang API deployed as a Vercel Serverless Function that returns your public IP address.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks