youtube-dl-service/backend/main.go
2021-10-11 06:19:42 +02:00

26 lines
471 B
Go

package main
import (
"github.com/gin-gonic/gin"
"github.com/gin-contrib/cors"
)
func main() {
r := gin.Default()
r.Use(cors.New(cors.Config{
AllowOrigins: []string{"http://localhost:8080", "http://localhost:5000"},
AllowCredentials: true,
AllowHeaders: []string{"*"},
}))
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false,
})
})
r.Run()
}