switch db schema to snake case for better frontend/backend/db integration

This commit is contained in:
2024-05-05 16:13:22 +02:00
parent a7ad330b27
commit b2ef584057
11 changed files with 51 additions and 41 deletions

View File

@@ -9,6 +9,7 @@ import (
"syscall"
"time"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/vcscsvcscs/GenerationsHeritage/backend/handlers"
"github.com/vcscsvcscs/GenerationsHeritage/backend/memgraph"
@@ -43,6 +44,11 @@ func main() {
memgraphDriver := memgraph.InitDatabase(*memgraphURI, *memgraphUser, *memgraphPass)
router := gin.Default()
router.Use(cors.New(cors.Config{
AllowOrigins: []string{"http://localhost:5173", "http://localhost"},
AllowCredentials: true,
MaxAge: 12 * time.Hour,
}))
router.GET("/health", hc.HealthCheckHandler())
router.GET("/person", handlers.ViewPerson(memgraphDriver))
router.POST("/person", handlers.CreatePerson(memgraphDriver))