From 11e572c414eb872ccf5c61d4d63bcb3f32fa72cc Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Mon, 3 Nov 2025 11:59:00 +0800 Subject: [PATCH] Defaulted to localhost --- backend/main.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/backend/main.go b/backend/main.go index b1882ab..295ad69 100644 --- a/backend/main.go +++ b/backend/main.go @@ -18,12 +18,12 @@ import ( ) // DEV -// var connection string = "root:superuser@tcp(localhost:3306)/iips" -// var connectionPops string = "root:superuser@tcp(localhost:3306)/pops" +var connection string = "root:superuser@tcp(localhost:3306)/iips" +var connectionPops string = "root:superuser@tcp(localhost:3306)/pops" // SERVER -var connection string = "iips:iipsuser@tcp(192.168.7.100:3306)/iips" -var connectionPops string = "pops:Pops2023!@tcp(192.168.76.10:3306)/pops" +// var connection string = "iips:iipsuser@tcp(192.168.7.100:3306)/iips" +// var connectionPops string = "pops:Pops2023!@tcp(192.168.76.10:3306)/pops" func main() { connect() @@ -44,23 +44,23 @@ func connect() { router.Use(cors.Default()) //DEV - // router.Use(cors.New(cors.Config{ - // AllowOrigins: []string{"http://localhost:5173"}, - // AllowMethods: []string{"GET", "POST"}, - // AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"}, - // ExposeHeaders: []string{"Content-Length"}, - // AllowCredentials: true, - // })) - - //SERVER router.Use(cors.New(cors.Config{ - AllowAllOrigins: true, + AllowOrigins: []string{"http://localhost:5173"}, AllowMethods: []string{"GET", "POST"}, - AllowHeaders: []string{"Origin"}, + AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"}, ExposeHeaders: []string{"Content-Length"}, AllowCredentials: true, })) + //SERVER + // router.Use(cors.New(cors.Config{ + // AllowAllOrigins: true, + // AllowMethods: []string{"GET", "POST"}, + // AllowHeaders: []string{"Origin"}, + // ExposeHeaders: []string{"Content-Length"}, + // AllowCredentials: true, + // })) + router.StaticFile("/", "static/index.html") // shield := "inquiry"