Files
wallet-go-api/pkg/utl/server/server.go
Fran Jurmanović 3a5138eb83 project structure
2021-05-02 20:35:00 +02:00

23 lines
295 B
Go

package server
import (
"os"
"github.com/gin-gonic/gin"
)
func Start() *gin.Engine {
r := gin.Default()
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
}