🎉 init backend
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
9bc69f9c58
commit
3b7d4e0021
5 changed files with 221 additions and 0 deletions
21
backend/cmd/api/main.go
Normal file
21
backend/cmd/api/main.go
Normal 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")
|
||||
}
|
Reference in a new issue