22 lines
454 B
Go
22 lines
454 B
Go
|
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")
|
||
|
}
|