2024-03-27 16:41:57 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Run() {
|
2024-09-15 18:36:42 +00:00
|
|
|
gin.SetMode(gin.ReleaseMode)
|
2024-03-27 16:41:57 +00:00
|
|
|
r := gin.Default()
|
2024-09-15 18:36:42 +00:00
|
|
|
|
|
|
|
r.GET("/", func(c *gin.Context) {
|
2024-09-15 16:57:03 +00:00
|
|
|
c.JSON(200, gin.H{
|
2024-09-15 18:36:42 +00:00
|
|
|
"message": "Mensen API",
|
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 18:36:42 +00:00
|
|
|
r.Run(":80")
|
2024-03-27 16:41:57 +00:00
|
|
|
}
|