moved api to golang and dashboard do nodejs

This commit is contained in:
RyanBakkes
2022-08-28 10:39:38 +02:00
parent 545cf0cf50
commit b7dcb1afe2
15 changed files with 479 additions and 305 deletions

View File

@@ -0,0 +1,29 @@
package controllers
import (
"context"
"fmt"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
)
func GetGames(db *mongo.Database){
coll := db.Collection("Games")
var result bson.M
cur, err := coll.Find(context.TODO(), bson.D{{}})
if err != nil {
if err == mongo.ErrNoDocuments {
// This error means your query did not match any documents.
return
}
panic(err)
}
fmt.Println(cur)
fmt.Println(result)
}