mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
23 lines
295 B
Go
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
|
|
}
|