diff --git a/internal/dazBlog/README.md b/internal/dazBlog/README.md new file mode 100644 index 0000000..d5ad43c --- /dev/null +++ b/internal/dazBlog/README.md @@ -0,0 +1,12 @@ +## dazBlog 目录架构 +- dazBlog.go + - Cobra 运行入口 + - 管理子命令 + - web 服务入口 +- helper.go + - 使用 `viper` 读取配置文件 + +## web 服务框架 +- 使用 `gin` 框架 +- HTTP 请求处理流程 +[HTTP 请求处理流程](../resource/HTTP.jpg) \ No newline at end of file diff --git a/internal/dazBlog/dazBlog.go b/internal/dazBlog/dazBlog.go index b443a2a..0ffd48f 100644 --- a/internal/dazBlog/dazBlog.go +++ b/internal/dazBlog/dazBlog.go @@ -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{}) diff --git a/configs/404.html b/internal/resource/404.html similarity index 100% rename from configs/404.html rename to internal/resource/404.html diff --git a/internal/resource/HTTP.jpg b/internal/resource/HTTP.jpg new file mode 100644 index 0000000..30233e1 Binary files /dev/null and b/internal/resource/HTTP.jpg differ