some progress

I am currently following a video guide
This commit is contained in:
AustrianToast 2024-04-14 20:52:06 +02:00
parent 09d5828812
commit 2da80d470a
No known key found for this signature in database
GPG Key ID: 5CD422268E489EB4

View File

@ -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)