Skip to content

Commit 37fad65

Browse files
authored
Merge pull request #48 from joncrangle/feat/air
Add air live reload
2 parents 394eaf9 + 6f28773 commit 37fad65

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.air.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
root = "./"
2+
testdata_dir = "testdata"
3+
tmp_dir = "tmp"
4+
5+
[build]
6+
args_bin = []
7+
bin = "./tmp/main"
8+
cmd = "go build -o ./tmp/main ./cmd"
9+
delay = 1000
10+
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
11+
exclude_file = []
12+
exclude_regex = ["_test.go"]
13+
exclude_unchanged = false
14+
follow_symlink = false
15+
full_bin = "RULESET=./ruleset.yaml ./tmp/main"
16+
include_dir = []
17+
include_ext = ["go", "tpl", "tmpl", "yaml", "html"]
18+
include_file = []
19+
kill_delay = "0s"
20+
log = "build-errors.log"
21+
poll = false
22+
poll_interval = 0
23+
post_cmd = []
24+
pre_cmd = ["echo 'dev' > handlers/VERSION"]
25+
rerun = false
26+
rerun_delay = 500
27+
send_interrupt = false
28+
stop_on_error = false
29+
30+
[color]
31+
app = ""
32+
build = "yellow"
33+
main = "magenta"
34+
runner = "green"
35+
watcher = "cyan"
36+
37+
[log]
38+
main_only = false
39+
time = false
40+
41+
[misc]
42+
clean_on_exit = true
43+
44+
[screen]
45+
clear_on_rebuild = true
46+
keep_scroll = true

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,14 @@ echo "dev" > handlers/VERSION
193193
RULESET="./ruleset.yaml" go run cmd/main.go
194194
```
195195

196+
### Optional: Live reloading development server with [cosmtrek/air](https://github.com/cosmtrek/air)
197+
198+
Install air according to the [installation instructions](https://github.com/cosmtrek/air#installation).
199+
200+
Run a development server at http://localhost:8080:
201+
202+
```bash
203+
air # or the path to air if you haven't added a path alias to your .bashrc or .zshrc
204+
```
205+
196206
This project uses [pnpm](https://pnpm.io/) to build a stylesheet with the [Tailwind CSS](https://tailwindcss.com/) classes. For local development, if you modify styles in `form.html`, run `pnpm build` to generate a new stylesheet.

0 commit comments

Comments
 (0)