Skip to content

Commit af5761b

Browse files
authored
feat: use workspace & add launch config (flipped-aurora#1114)
* feat: use workspace & add launch config
1 parent 044c5f4 commit af5761b

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,24 @@ swag init
165165

166166
> 执行上面的命令后,server目录下会出现docs文件夹里的 `docs.go`, `swagger.json`, `swagger.yaml` 三个文件更新,启动go服务之后, 在浏览器输入 [http://localhost:8888/swagger/index.html](http://localhost:8888/swagger/index.html) 即可查看swagger文档
167167
168+
### 2.4 VSCode工作区
169+
170+
#### 2.4.1 开发
171+
172+
使用`VSCode`打开根目录下的工作区文件`gin-vue-admin.code-workspace`,在边栏可以看到三个虚拟目录:`backend``frontend``root`
173+
174+
#### 2.4.2 运行/调试
175+
176+
在运行和调试中也可以看到三个task:`Backend``Frontend``Both (Backend & Frontend)`。运行`Both (Backend & Frontend)`可以同时启动前后端项目。
177+
178+
#### 2.4.3 settings
179+
180+
在工作区配置文件中有`go.toolsEnvVars`字段,是用于`VSCode`自身的go工具环境变量。此外在多go版本的系统中,可以通过`gopath``go.goroot`指定运行版本。
181+
182+
```json
183+
"go.gopath": null,
184+
"go.goroot": null,
185+
```
168186

169187
## 3. 技术选型
170188

gin-vue-admin.code-workspace

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "server",
5+
"name": "backend"
6+
},
7+
{
8+
"path": "web",
9+
"name": "frontend"
10+
},
11+
{
12+
"path": ".",
13+
"name": "root"
14+
}
15+
],
16+
"settings": {
17+
"go.toolsEnvVars": {
18+
"GOPROXY": "https://goproxy.cn,direct",
19+
"GONOPROXY": "none;"
20+
}
21+
},
22+
"launch": {
23+
"version": "0.2.0",
24+
"configurations": [
25+
{
26+
"type": "go",
27+
"request": "launch",
28+
"name": "Backend",
29+
"cwd": "${workspaceFolder:backend}",
30+
"program": "${workspaceFolder:backend}/main.go"
31+
},
32+
{
33+
"type": "node",
34+
"request": "launch",
35+
"cwd": "${workspaceFolder:frontend}",
36+
"name": "Frontend",
37+
"runtimeExecutable": "npm",
38+
"runtimeArgs": ["run-script", "serve"]
39+
}
40+
],
41+
"compounds": [
42+
{
43+
"name": "Both (Backend & Frontend)",
44+
"configurations": ["Backend", "Frontend"],
45+
"stopAll": true
46+
}
47+
]
48+
}
49+
}

0 commit comments

Comments
 (0)