snippetbox

module
v0.0.0-...-17ab5b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: MIT

README

Snippetbox app

Simple app from Alex Edward's book "let's Go". Written in Go 1.22

How to run

Just use docker compose, this will create MySQL and Go backend services. All Go files are watched by air: any changes will be detected and app will rebuild

docker compose up -d

App can be found on https://localhost:4000 (yes, it has self-signed certificate)

Powered by

Project structure

cmd/web

Core logic of app

  • handlers.go, routes.go – logic of handlers and URL patterns
  • middleware.go – some middlewares, e.g. logging, authentication and permission checks
  • templates.go – helpers functions for templates
  • helpers.go - useful shortcuts, e.g. serverError and render
internal
  • models representation, SQL
  • functions for testing
  • validation
ui

HTML with Go templating

Directories

Path Synopsis
cmd
web command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL