Serving static files

  1. func main() {
  2. router := gin.Default()
  3. router.Static("/assets", "./assets")
  4. router.StaticFS("/more_static", http.Dir("my_file_system"))
  5. router.StaticFile("/favicon.ico", "./resources/favicon.ico")
  6. // Listen and serve on 0.0.0.0:8080
  7. router.Run(":8080")
  8. }