A simple REST API that provides CRUD operations on a hero
object, it was built using Go and PostgreSQL.
This project makes use of gorilla/mux, gorm, and godotenv.
1. Clone the application
git clone https://github.com/nicolaspearson/go.heroes.api.git
2. Start the database
docker-compose up
3. Build and run the app
go run main.go
The app will start running at http://localhost:8000
go build
./go-hero
The app will start running at http://localhost:8000
The following endpoints are available:
POST /user/register
POST /user/login
GET /hero?id={heroId}
GET /heroes
POST /hero
PUT /hero/{heroId}
DELETE /hero/{heroId}
Run this command to benchmark request performance:
wrk -d1m http://localhost:8000/heroes