project structure

This commit is contained in:
Fran Jurmanović
2021-05-02 20:35:00 +02:00
parent 9a272d47c4
commit 3a5138eb83
10 changed files with 292 additions and 0 deletions

22
pkg/utl/server/server.go Normal file
View File

@@ -0,0 +1,22 @@
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
}