about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.go b/main.go
index 3c0a345..47ea3f7 100644
--- a/main.go
+++ b/main.go
@@ -17,6 +17,7 @@
 package main
 
 import (
+	"database/sql"
 	"fmt"
 	"git.darknebu.la/GalaxySimulator/structs"
 	"log"
@@ -27,6 +28,10 @@ import (
 	//"git.darknebu.la/GalaxySimulator/structs"
 )
 
+var (
+	db *sql.DB
+)
+
 func indexHandler(w http.ResponseWriter, r *http.Request) {
 	log.Println("[ ] The indexHandler was accessed")
 	_, _ = fmt.Fprintf(w, indexEndpoint())
@@ -117,6 +122,9 @@ func main() {
 	//
 	//router.HandleFunc("/readdir/{dirname}", readdirHandler).Methods("GET")
 
+	db = connectToDB()
+	db.SetMaxOpenConns(75)
+
 	fmt.Println("Database Container up on port 8081")
 	log.Fatal(http.ListenAndServe(":8081", router))
 }