🎉 init backend

Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
haraldnilsen 2023-12-14 20:50:06 +01:00
parent 9bc69f9c58
commit 3b7d4e0021
5 changed files with 221 additions and 0 deletions

21
backend/cmd/api/main.go Normal file
View file

@ -0,0 +1,21 @@
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
// Define a basic GET request handler
router.GET("/ping", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "pong",
})
})
// Run the server on port 8080
router.Run(":8080")
}