Building a Golang webserver to store / retrieve text snippets.
Learning about backend development concepts while familiarizing with Golang:
- Routing and http handlers
- Middleware for logging, auth, etc.
- Interacting with Postgres
- HTML Templating
- Processing and validating forms
- Sessions with cookies
- Security (server headers, TLS, CSRF prevention, password storage with bcrypt)
- User authorization and authentication
- Golang Request Context to pass data to downstream handlers
- Flash messages
- Golang embedded files using embed.FS
- Testing http handlers
- Mocking data models for testing
- Integrating testing with test database
mkdir tls
cd tls
- Using
crypto/tls
generate_cert.go
tool, rungo run /path/to/generate_cert.go --rsa-bites=2048 --host=localhost
- Install postgres and run
sql/snippets.sql
setup script to create necessary tables and user go run ./cmd/web