Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wafer-bw/whatsmyip
Golang API deployed as a Vercel Serverless Function that returns your public IP address.
https://github.com/wafer-bw/whatsmyip
api go golang vercel-serverless
Last synced: 10 days ago
JSON representation
Golang API deployed as a Vercel Serverless Function that returns your public IP address.
- Host: GitHub
- URL: https://github.com/wafer-bw/whatsmyip
- Owner: wafer-bw
- License: mit
- Created: 2020-09-16T20:49:13.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-04T14:31:01.000Z (11 days ago)
- Last Synced: 2024-11-04T15:33:16.508Z (11 days ago)
- Topics: api, go, golang, vercel-serverless
- Language: Go
- Homepage: https://whatsmyip.wafer-bw.vercel.app
- Size: 293 KB
- Stars: 19
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# whatsmyip
Golang API running as a [Vercel Serverless Function](https://vercel.com/docs/functions/serverless-functions) which returns your public IP address## Links
* [Homepage](https://whatsmyip.wafer-bw.vercel.app)
* [API](https://whatsmyip.wafer-bw.vercel.app/api) - supports the following `accept` headers:
* `application/json`
* `application/protobuf`
* defaults to `text/plain`## Prerequisites
* Required
* [Go](https://golang.org/)
* Optional
* [Node.js and npm](https://nodejs.org/en/) for running/deploying with [Vercel](https://vercel.com/)
* [protoc-gen-go](https://developers.google.com/protocol-buffers/docs/gotutorial) for updating the `protobuf` API contract found [here](./spec/spec.proto)## Setup
```sh
# 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](./Makefile) directly
```sh
# 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`:
```sh
go get github.com/golang/protobuf/protoc-gen-go
export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:/usr/local/go/bin
```