1 Star 1 Fork 4

bf/ms-go-blog 码神之路

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
router.go 734 Bytes
一键复制 编辑 原始数据 按行查看 历史
bftwq 提交于 2022-07-26 13:21 . 提交代码
package router
import (
"go_blog/api"
"go_blog/views"
"net/http"
)
type IndexData struct {
Title string `json:"title"`
Desc string `json:"desc"`
}
func Router() {
//1.页面 views 2(json)api 2.静态资源
http.HandleFunc("/", views.HTML.Index)
http.HandleFunc("/c/", views.HTML.Category)
http.HandleFunc("/login", views.HTML.Login)
http.HandleFunc("/api/v1/post", api.API.SaveAndUpdatePost)
http.HandleFunc("/api/v1/login", api.API.Login)
http.HandleFunc("/p/", views.HTML.Detail)
http.HandleFunc("/api/v1/post/", api.API.GetPost)
http.HandleFunc("/writing", views.HTML.Writing)
//静态资源处理
http.Handle("/resource/", http.StripPrefix("/resource/", http.FileServer(http.Dir("public/resource/"))))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/bftwq/ms-go-blog.git
git@gitee.com:bftwq/ms-go-blog.git
bftwq
ms-go-blog
ms-go-blog 码神之路
master

搜索帮助