1.6 KiB
Go Web Starter Kit
This is a fairly complete web development starter kit in Go. It tries to be as simple as possible without leaving out modern features like reactive UIs and database migrations. A primary thing that's included is working authentication, since that's the main thing holding people back when they first start, and also the easiest to get wrong.
In fact, if you look at how I do it in this first version it is WRONG so do not use this in production yet until I can make it correct. Just use it to learn for now.
Getting Started
You can get use this project working by doing this:
git clone \
https://git.learnjsthehardway.com/learn-code-the-hard-way/go-web-starter-kit.git my-project
cd my-project
Then on Linux/OSX you want to delete the .git
with this:
rm -rf .git
And on Windows you use the ever more clear and totally easier:
rm -recurse -force .git
Once you have that you can make it your own:
git init .
go mod tidy
cp config_example.toml config.toml
make dev
Warning On Windows you'll probably be asked to give the
webapp.exe
access to the Public and Private networks to use it.
You don't have to use the Makefile
but it's a lot easier than memorizing the various commands.
You can access the site by visiting https://127.0.0.1:7002/ but keep in mind this is the Air port, not your site's port. Air is a tool that will rebuild your Go project whenever you change the code (but NOT HTML/CSS, because that's annoying).