Mensa-API/server/server.go

19 lines
328 B
Go
Raw Normal View History

2024-03-27 16:41:57 +00:00
package server
import (
"github.com/gin-gonic/gin"
)
func Run() {
r := gin.Default()
2024-09-15 16:57:03 +00:00
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
2024-03-27 16:41:57 +00:00
})
2024-09-15 16:57:03 +00:00
})
r.GET("/state/:state", state)
2024-09-15 17:10:19 +00:00
r.GET("/city/:city", city)
r.GET("/mensa/:city/:mensa", mensa)
2024-09-15 16:57:03 +00:00
r.Run() // listen and serve on
2024-03-27 16:41:57 +00:00
}