A simple go web app illustrating:
- Reading TOML config files
- Connecting to mySQL DB
- Simple authentication
- Gorilla mux
- Gorilla sessions
- Storing passwords with bcrypt
- Application Context rather than global variables
git clone git@github.com:andrewaustin/go-example-webapp.git
cd go-example-webapp
cp config.example.toml config.toml
- Modify config.toml to suit your needs.
cat schemas/*.sql | mysql -u root -p -D <database name>
go run *.go
- Lock down routes
- REST endpoints
- Tests
- Use https://github.com/juju/errgo
Special thanks to Matt Silverlock (https://github.com/elithrar) for writing some excellent articles on web apps in go.