2 Star 0 Fork 1

rocket049/markdownweb

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
redirect.go 360 Bytes
一键复制 编辑 原始数据 按行查看 历史
rocket049 提交于 2020-02-26 12:53 +08:00 . 2020年 02月 26日 星期三 12:53:22 CST
package main
import (
"log"
"net/http"
"path"
"strings"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
a := strings.Split(r.Host, ":")
url1 := path.Join(a[0], r.URL.Path)
http.Redirect(w, r, "https://"+url1, 301)
//log.Println(url1)
})
err := http.ListenAndServe("127.0.0.1:8090", nil)
log.Println(err)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/rocket049/markdownweb.git
git@gitee.com:rocket049/markdownweb.git
rocket049
markdownweb
markdownweb
b576d5c98dd3

搜索帮助