PostCreate done
This commit is contained in:
9
main.go
9
main.go
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user