The response

Report a typo

The following code starts a Gin web server:

package main

import (
    "net/http"
    "github.com/gin-gonic/gin"
)

func main() {
    router := gin.Default()

    router.GET("/api", func(context *gin.Context) {
        context.String(http.StatusOK, "api")
    })

    router.Group("/api", func(context *gin.Context) {
        context.String(http.StatusOK, "api group")
    })

    router.Run()
}

What response will you get if you request a router with a URL http://localhost:8080/api?

Remember that you can copy the code into your IDE, run it, and get a response.

Enter a short text
___

Create a free account to access the full topic