Auto reload
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kekskurse 2021-11-09 17:20:18 +01:00
parent 37741ec415
commit 4c1e35e9e4
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4
5 changed files with 47 additions and 8 deletions

32
.air.toml Normal file
View file

@ -0,0 +1,32 @@
root = "."
tmp_dir = "tmp"
[build]
bin = "./tmp/main run"
cmd = "go build -o ./tmp/main ."
delay = 1000
exclude_dir = ["assets", "tmp", "vendor"]
exclude_file = []
exclude_regex = []
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
kill_delay = "0s"
log = "build-errors.log"
send_interrupt = false
stop_on_error = true
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
time = false
[misc]
clean_on_exit = false

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
.idea/ .idea/
go-sample-webpage go-sample-webpage
webapp webapp
tmp/

View file

@ -4,4 +4,7 @@ build:
init-dev: init-dev:
docker-compose up -d docker-compose up -d
sleep 30 sleep 30
go run ./ migrate go run ./ migrate
run-dev:
air

View file

@ -26,7 +26,13 @@ Its possitlbe to execute the migrations via `go run ./ migrate`. It execute the
Everything (include templaes and migration) can be added in one binary Everything (include templaes and migration) can be added in one binary
## Make commands ## Make commands
*todo* * build -> Build webapp
* init-dev -> Start docker copose
* run-dev -> Run Webapp with reload if someting is change (air)
## Docker Image
https://hub.docker.com/r/kekskurse/go-sample-webpage
# Dev # Dev
@ -41,7 +47,4 @@ Alles ist in einem binary
# next steps # next steps
* conifg per env * conifg per env
* makefile
* ci/Cd bis docker image bauen
* Hot reload while develop

View file

@ -1,4 +1,4 @@
<h1> <h1>
Hello {{ .title }} Hello {{ .title }}!
</h1> </h1>