1 Star 1 Fork 1

MrMriacle/Go原生搭建图片网站

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
router.go 491 Bytes
一键复制 编辑 原始数据 按行查看 历史
YinLei 提交于 2020-02-07 15:33 +08:00 . Go PhotoWebsite
package main
import (
"log"
"net/http"
)
/**
路由
*/
func Run(){
http.Handle("/static/",http.StripPrefix("/static/",http.FileServer(http.Dir("static/"))))
http.HandleFunc("/",IndexView)
http.HandleFunc("/upload",UploadView)
http.HandleFunc("/api/upload",ApiUpload)
http.HandleFunc("/api/list",ApiList)
http.HandleFunc("/api/delete",ApiDrop)
http.HandleFunc("/detail",DetailView)
http.HandleFunc("/list",ListView)
log.Println("Run 8080...")
http.ListenAndServe(":8080",nil)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mrmriacle/go_to_build_a_picture_website.git
git@gitee.com:mrmriacle/go_to_build_a_picture_website.git
mrmriacle
go_to_build_a_picture_website
Go原生搭建图片网站
master

搜索帮助