diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..d3d6fbb --- /dev/null +++ b/.air.toml @@ -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 diff --git a/.gitignore b/.gitignore index 4d115e6..bbc019d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ go-sample-webpage -webapp \ No newline at end of file +webapp +tmp/ \ No newline at end of file diff --git a/Makefile b/Makefile index e41ec95..2a027de 100644 --- a/Makefile +++ b/Makefile @@ -4,4 +4,7 @@ build: init-dev: docker-compose up -d sleep 30 - go run ./ migrate \ No newline at end of file + go run ./ migrate + +run-dev: + air \ No newline at end of file diff --git a/readme.md b/readme.md index aeba963..02d6338 100644 --- a/readme.md +++ b/readme.md @@ -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 ## 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 @@ -41,7 +47,4 @@ Alles ist in einem binary # next steps -* conifg per env -* makefile -* ci/Cd bis docker image bauen -* Hot reload while develop \ No newline at end of file +* conifg per env \ No newline at end of file diff --git a/templates/index.tmpl b/templates/index.tmpl index f723b84..ce36f7c 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -1,4 +1,4 @@