package kokDB

import (
	"github.com/gofiber/fiber/v3"
	"github.com/gofiber/fiber/v3/middleware/cors"
)

func KokDBRouting(app *fiber.App) {

	///
	fapiv1 := app.Group("/fapiv1")

	fapiv1.Use(cors.New(cors.Config{
		AllowOrigins:     []string{"https://fikoyt.com:444", "https://fikoyt.com:9000"},                 // String dilimi olarak belirt
		AllowMethods:     []string{"GET", "POST", "HEAD", "PUT", "DELETE", "PATCH", "OPTIONS", "TRACE"}, // İzin verilen HTTP metodları
		AllowHeaders:     []string{"*", "Content-Type", "Authorization", "Mode", "cihaz_kimlik", "cihaz_bilgi", "uygulama", "access-control-allow-origin", "access-control-allow-credentials", "cihaz_tipi", "Content-Type", "X-Requested-With"},
		AllowCredentials: true, AllowPrivateNetwork: true, ExposeHeaders: []string{"*", "Content-Length", "Content-Type", "X-Requested-With"},
	}))

	fapiv1.Post("/fikoyt.com.FikoYT.sistem.DB.:db.aggregate", fikoyt_sistem_db_agregate)
	fapiv1.Post("/fikoyt.com.FikoYT.sistem.DB.:db.ekle", fikoyt_sistem_db_ekle)
	fapiv1.Post("/fikoyt.com.FikoYT.sistem.DB.:db.sil", fikoyt_sistem_db_sil)
	fapiv1.Post("/fikoyt.com.FikoYT.sistem.DB.:db.guncelle", fikoyt_sistem_db_guncelle)

	// fapiv1.Post("/fikoyt.com.test", fikoyt_sistem_test)

	// fapiv1.Get("/fikoyt.com.FikoYT.sistem.aktif-kullanici.profilResmi", fikoyt_sistem_aktif_kullanici_profil_resmi)

	// fapiv1.Get("/fikoyt.com.FikoYT.sistem.windows.guncelleme.bilgi", fikoyt_sistem_bilgi_guncelleme)
}
