Files
wallet-go-api/pkg/utl/server/server.go
Fran Jurmanović 20894ee42e starter
2021-05-06 20:09:29 +02:00

22 lines
288 B
Go

package server
import (
"os"
"github.com/gin-gonic/gin"
)
func Start(r *gin.Engine) *gin.Engine {
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
port := os.Getenv("PORT")
if port == "" {
port = "4000"
}
r.Run(":" + port)
return r
}