gofound-webapp

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT

README

gofound-webapp

A project template for creating an web application in Go, with example content.

Used packages
  • github.com/alexedwards/scs/mysqlstore
  • github.com/alexedwards/scs/v2
  • github.com/go-playground/form/v4
  • github.com/go-sql-driver/mysql
  • github.com/julienschmidt/httprouter
  • github.com/justinas/alice
  • github.com/justinas/nosurf
  • golang.org/x/crypto

Clone repo

git clone https://github.com/bartvanbenthem/gofound-webapp.git
cd gofound-webapp

Start MySQL Database

cd project
docker-compose up -d
cd ..

Start the WebServer

go test -vet=off -v ./cmd/web/
go run ./cmd/web/ --addr=":4000" \
                  --dsn="web:pass@/gofound?parseTime=true" \
                  --smtp-host="localhost" \
                  --smtp-port="1025" \
                  --smtp-user="" \
                  --smtp-password="" \
                  --mail-address="mail@gofound.nl" \
                  --cert="./tls/cert.pem" \
                  --key="./tls/key.pem"

Test SendMail

Start MailHog to test mail capabillities

$ go get github.com/mailhog/MailHog
$ ~/go/bin/MailHog

create self signed certificates

cd tls
go run /usr/local/go/src/crypto/tls/generate_cert.go --rsa-bits=2048 --host=localhost

Directories

Path Synopsis
cmd
web
internal

Jump to

Keyboard shortcuts

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