PostCreate done

This commit is contained in:
2024-02-21 19:13:56 -06:00
parent 7bd744339a
commit 4e4d52527f
4 changed files with 35 additions and 8 deletions

View File

@@ -1,8 +1,7 @@
package main
import (
"net/http"
"gitea.sitodosi.com/betology/go-crud/controllers"
"gitea.sitodosi.com/betology/go-crud/initializers"
"github.com/gin-gonic/gin"
)
@@ -15,11 +14,7 @@ func init() {
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "pong",
})
})
r.POST("/posts", controllers.PostsCreate)
r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}