Skip to content

heiku-jiqu/snippetapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snippetapp

Building a Golang webserver to store / retrieve text snippets.

Motivation

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

Using

  1. mkdir tls
  2. cd tls
  3. Using crypto/tls generate_cert.go tool, run go run /path/to/generate_cert.go --rsa-bites=2048 --host=localhost
  4. Install postgres and run sql/snippets.sql setup script to create necessary tables and user
  5. go run ./cmd/web

About

Golang webserver for snippets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published