it listens and says hello
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
router := gin.Default()
|
||||
|
||||
router.GET("/hello", func(ctx *gin.Context) {
|
||||
ctx.String(200, "Ahoy matey!")
|
||||
})
|
||||
|
||||
if err := router.Run(":5180"); err != nil {
|
||||
log.Fatal("failure to start the server")
|
||||
}
|
||||
|
||||
fmt.Println("listening on port 5180...")
|
||||
}
|
||||
Reference in New Issue
Block a user