Skip to content

Commit

Permalink
Use client IP by default
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyFrogeye committed May 5, 2020
1 parent 77cb1f2 commit 930b338
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func main() {
e.Static("*", "./static")

// Bind all API endpoint handlers
e.GET("/lookup", func(c echo.Context) error {
return c.JSON(http.StatusOK, ic.Lookup(c.RealIP()))
})
e.GET("/lookup/:ip", func(c echo.Context) error {
return c.JSON(http.StatusOK, ic.Lookup(c.Param("ip")))
})
Expand Down

0 comments on commit 930b338

Please sign in to comment.