Skip to content

Commit

Permalink
simple health
Browse files Browse the repository at this point in the history
  • Loading branch information
bkawk committed Feb 4, 2023
1 parent e35e8f8 commit 933b5cd
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions api/handlers/health.go
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
package handlers

import (
"context"
"fmt"
"net/http"

"github.com/labstack/echo/v4"
"go.mongodb.org/mongo-driver/mongo"
)

type UserStr struct {
Username string
Password string `bson:"password,omitempty"`
}

// HealthGet handles health check requests
func HealthGet(c echo.Context) error {
db := c.Get("db").(*mongo.Database)
newUser := UserStr{Username: "bkawk", Password: "secret"}
result, err := db.Collection("test").InsertOne(context.TODO(), newUser)
if err != nil {
panic(err)
}
fmt.Println(result)
return c.JSON(http.StatusOK, map[string]string{
"status": "OK",
})
Expand Down

0 comments on commit 933b5cd

Please sign in to comment.