gin
This commit is contained in:
parent
9c57616874
commit
6a2ecee517
37
gin/1-try/.air.toml
Normal file
37
gin/1-try/.air.toml
Normal file
@ -0,0 +1,37 @@
|
||||
root = "."
|
||||
testdata_dir = "testdata"
|
||||
tmp_dir = "tmp"
|
||||
|
||||
[build]
|
||||
args_bin = []
|
||||
bin = "./tmp/main"
|
||||
cmd = "go build -o ./tmp/main ."
|
||||
delay = 1000
|
||||
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
|
||||
exclude_file = []
|
||||
exclude_regex = ["_test.go"]
|
||||
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
|
||||
|
||||
[screen]
|
||||
clear_on_rebuild = false
|
@ -17,4 +17,16 @@ go build -o server main.go
|
||||
|
||||
```shell
|
||||
go mod vendor
|
||||
```
|
||||
|
||||
### 热更新
|
||||
|
||||
```shell
|
||||
# 安装
|
||||
go install github.com/cosmtrek/air@latest
|
||||
|
||||
# 初始化
|
||||
air init
|
||||
# 运行
|
||||
air -c .air.toml
|
||||
```
|
@ -11,7 +11,7 @@ func main() {
|
||||
context.JSON(200, gin.H{
|
||||
"status": "1",
|
||||
"message": "请求成功",
|
||||
"data": "Hello",
|
||||
"data": "Hello333",
|
||||
})
|
||||
})
|
||||
// 启动HTTP服务,默认在0.0.0.0:8080启动服务
|
||||
|
BIN
gin/1-try/tmp/main
Executable file
BIN
gin/1-try/tmp/main
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user