Created
May 7, 2020 06:17
-
-
Save a60814billy/590726f25f841a94bb63c3c3cdf934e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "github.com/gin-gonic/gin" | |
func main() { | |
app := gin.Default() | |
app.GET("/", func(c *gin.Context) { | |
hostname := c.Request.Host | |
c.Writer.Write([]byte(hostname)) | |
}) | |
app.Run(":8081") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment