router-ui-backend/main.go

21 lines
453 B
Go
Raw Normal View History

2024-09-06 08:18:57 +00:00
package main
import (
"router-ui-backend/api"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
router.Use(cors.New(cors.Config{
AllowOrigins: []string{"*"},
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowHeaders: []string{"Origin", "Content-Type", "Accept", "Authorization"},
}))
router.GET("/overviewItems", api.GetOverviewItems)
router.Run("localhost:8080")
}