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

martinAlt335/whatsmyip

 
 

Repository files navigation

whatsmyip

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

tests gopherbadger-tag-do-not-edit CodeQL go report

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

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

References

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 77.9%
  • HTML 14.1%
  • JavaScript 4.1%
  • Makefile 3.9%