some progress
I am currently following a video guide
This commit is contained in:
parent
09d5828812
commit
2da80d470a
5
main.go
5
main.go
@ -35,6 +35,7 @@ func main() {
|
|||||||
router := gin.Default()
|
router := gin.Default()
|
||||||
router.SetTrustedProxies(nil)
|
router.SetTrustedProxies(nil)
|
||||||
|
|
||||||
|
router.POST("/upload", ReceiveFile)
|
||||||
router.GET("/videos", getvideos)
|
router.GET("/videos", getvideos)
|
||||||
router.GET("/videos/:id", getvideoByID)
|
router.GET("/videos/:id", getvideoByID)
|
||||||
router.POST("/videos", postvideos)
|
router.POST("/videos", postvideos)
|
||||||
@ -45,6 +46,10 @@ func main() {
|
|||||||
router.Run("localhost:8080")
|
router.Run("localhost:8080")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ReceiveFile(c *gin.Context) {
|
||||||
|
c.IndentedJSON(http.StatusOK, "Received successfully")
|
||||||
|
}
|
||||||
|
|
||||||
// getvideos responds with the list of all videos as JSON.
|
// getvideos responds with the list of all videos as JSON.
|
||||||
func getvideos(c *gin.Context) {
|
func getvideos(c *gin.Context) {
|
||||||
c.IndentedJSON(http.StatusOK, videos)
|
c.IndentedJSON(http.StatusOK, videos)
|
||||||
|
Loading…
Reference in New Issue
Block a user