diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -27,5 +27,15 @@ func main(){ c.SaveUploadedFile(file, dst) c.String(http.StatusOK, fmt.Sprintf("'%s' uploaded!\n", file.Filename)) }) + + router.GET("/", func(c *gin.Context) { + c.String(http.StatusOK, fmt.Sprintf("HTTP WORKS TOO!")) + }) + + var safeFS http.FileSystem = http.Dir("./files") + router.GET("/:name", func(c *gin.Context) { + c.FileFromFS(c.Param("name"), safeFS) + }) + router.Run(":8080") } |
