Skip to content

Commit

Permalink
docs: add README for web server
Browse files Browse the repository at this point in the history
Signed-off-by: daz-3ux <[email protected]>
  • Loading branch information
Daz-3ux committed Sep 13, 2023
1 parent 179ba7d commit 59955a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions internal/dazBlog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## dazBlog 目录架构
- dazBlog.go
- Cobra 运行入口
- 管理子命令
- web 服务入口
- helper.go
- 使用 `viper` 读取配置文件

## web 服务框架
- 使用 `gin` 框架
- HTTP 请求处理流程
[HTTP 请求处理流程](../resource/HTTP.jpg)
2 changes: 1 addition & 1 deletion internal/dazBlog/dazBlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func run() error {
g := gin.New()

// register 404 handler
g.LoadHTMLGlob("configs/*.html")
g.LoadHTMLGlob("internal/resource/*.html")
g.NoRoute(func(c *gin.Context) {
//c.JSON(http.StatusOK, gin.H{"code": 10003, "message": "404 Not Found"})
c.HTML(http.StatusNotFound, "404.html", gin.H{})
Expand Down
File renamed without changes.
Binary file added internal/resource/HTTP.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 59955a9

Please sign in to comment.