Skip to content

Commit

Permalink
chore: add vscode debug config
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie committed May 29, 2024
1 parent 6ab49b4 commit dbd2bcf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Air",
"type": "go",
"mode": "remote",
"request": "attach",
"host": "127.0.0.1",
"port": 2345
}
]
}
17 changes: 17 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Web Server",
"type": "shell",
"command": "air",
"args": ["-c", "${workspaceFolder}/cmd/web/.air.toml"]
},
{
"label": "Start API Server",
"type": "shell",
"command": "air",
"args": ["-c", "${workspaceFolder}/cmd/api/.air.toml"]
}
]
}
9 changes: 9 additions & 0 deletions cmd/api/.air.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# .air.toml
root = "."
tmp_dir = "tmp"

[build]
cmd = "go build -o ./tmp/api cmd/api/main.go"
bin = "./tmp/api"
full_bin = "dlv exec ./tmp/api --listen=127.0.0.1:2345 --headless=true --api-version=2 --accept-multiclient --continue --log -- "
delay = 1000 # ms
exclude_dir = ["assets", "tmp", "vendor"]
include_ext = ["go", "tpl", "tmpl", "html"]
exclude_regex = ["_test\\.go"]

[misc]
clean_on_exit = true

[screen]
clear_on_rebuild = true
keep_scroll = true
9 changes: 9 additions & 0 deletions cmd/web/.air.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# .air.toml
root = "."
tmp_dir = "tmp"

[build]
cmd = "go build -o ./tmp/web cmd/web/main.go"
bin = "./tmp/web"
full_bin = "dlv exec ./tmp/web --listen=127.0.0.1:2345 --headless=true --api-version=2 --accept-multiclient --continue --log -- "
delay = 1000 # ms
exclude_dir = ["assets", "tmp", "vendor"]
include_ext = ["go", "tpl", "tmpl", "html"]
exclude_regex = ["_test\\.go"]

[misc]
clean_on_exit = true

[screen]
clear_on_rebuild = true
keep_scroll = true

0 comments on commit dbd2bcf

Please sign in to comment.