This was inspired by Key & Peele's "East/West Bowl" comedy sketch(es), though this is the NFL draft (with one round) following the bowl. The players used are from season 2 video. Season 1 video can be found here
(disclaimer: the positions and year/class are made up by me (i.e., not explicity stated in the videos))
This is just a small thing I did as an excuse to mess around with Go for the first time
/index
/players/
/test
/files/
(use this route to see contents of the /files directory, or go to /files/<file_name><file_extension>)
go run *.go
or go build
followed by ./nfl_draft
curl --request GET --url <base_url>/players/:id
ex: curl --request GET --url http://localhost:8080/players/3
curl --request GET --url <base_url>/players/
ex: curl --request GET --url http://localhost:8080/players/
url: base url id: id of the desired player
curl --request POST --url <base_url>/players/id
ex: curl --request POST --url http://localhost:8080/players/3
- "appropriately" handle errors
- WRITE TESTS
- make an event table that records what team drafted which player (and when)
- allow user to add more players to be drafted (from other seasons)
- write more idiomatic Go
- swagger docs (or similar) for easy visibility of available routes
- DONE - reset button to "undraft" all players and start over
sudo -u postgres psql
CREATE DATABASE players_dev;
\c players_dev
CREATE TABLE players;
- insert the sample data (found in players.setup.sql)
- "Go in Practice" by Matt Butcher and Matt Farina
- Go docs
- Simple JSON Rest API in Go (tutorial)
- Medium article "Build RESTful API in Go and MongoDB" by Mohamed Labouardy
- ENABLING CORS ON A GO WEB SERVER, an article by Flavio Copes
- How to not use an http-router in go, an article by Axel Wagner