initial refactor in go

This commit is contained in:
2024-02-18 00:50:53 +02:00
parent 10dd226ab1
commit 02c85fcf28
10 changed files with 294 additions and 0 deletions

27
main.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"context"
"acooldomain.co/backend/dbhandler"
"acooldomain.co/backend/users"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
client, err := dbhandler.Connect("mongodb://localhost:27017")
defer func() {
if err = client.Disconnect(context.TODO()); err != nil {
panic(err)
}
}()
if err != nil {
panic(err)
}
users.LoadGroup(router.Group("/users"), client)
router.Run("localhost:8080")
}