Skip to content

Commit

Permalink
Fix Problem
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyiyo committed Apr 25, 2021
1 parent 3ba5043 commit 6f046a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var USER string
var PASSWORD string

func redicertShortLink(c *gin.Context) {
shortLinkCode := strings.ReplaceAll((c.Request.URL.Path), "/", "")
shortLinkCode := c.Param("ShortLinkCode")

db, err := sql.Open(
"postgres",
Expand Down Expand Up @@ -386,8 +386,7 @@ func main() {
route.LoadHTMLGlob("static/*")

route.GET("/", indexPage)
route.GET("/ShortLinkCode", redicertShortLink)
route.GET("/portal/*portal", portal)
route.GET("/:ShortLinkCode", redicertShortLink)

route.POST("/api/v1/create", shortLinkCreate)
route.POST("/api/v1/list", shortLinkList)
Expand All @@ -399,5 +398,5 @@ func main() {
AllowOrigins: []string{"*"},
}))

route.Run(":32156")
route.Run("127.0.0.1:32156")
}
2 changes: 1 addition & 1 deletion static/portal_index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
document.write("<p>系統會自動記錄您目前的 IP 位置 ", json.ip, "</p>");
}
</script>
<script type="application/javascript" src="https://api.ip.sb/jsonip?callback=getip"></script>
<script type="application/javascript" src="https://ip.steveyi.net/ip/"></script>
<button class="ts right floated button">登入</button>
</form>
</div>
Expand Down

0 comments on commit 6f046a5

Please sign in to comment.