-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
29 lines (25 loc) · 861 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import (
"log"
"github.com/dvg-dev/food-aggregator/helpers"
"github.com/dvg-dev/food-aggregator/receivers"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
func main() {
log.Println("Starting the Food Aggregator Application at port 8080...")
helpers.InitURLs()
e := echo.New()
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
AllowOrigins: []string{"*"},
AllowMethods: []string{"*"},
}))
g := e.Group("/food-aggregator")
g.GET("/ping", receivers.Get.PingHandler)
g.GET("/buy-item/:name", receivers.Get.BuyByNameHandler)
g.GET("/buy-item-qty/:name/:quantity", receivers.Get.BuyByNameQty)
g.GET("/buy-item-qty-price/:name/:quantity/:price", receivers.Get.BuyByNameQtyPrice)
g.GET("/show-summary", receivers.Get.ShowSummary)
g.GET("/fast-buy-item/:name", receivers.Get.FastBuyItem)
e.Start(":8080")
}