title: How to serve statics files in Gin
body: <p>by following the tutorial I try to connect the frontend (React) to backend API (Gin), but the <code>static.Serve</code> doesn't work, error prompted as below:</p>
  <pre><code>cannot use static.Serve(&quot;/&quot;, static.LocalFile(&quot;./views&quot;, true)) (type &quot;github.com/gin-gonic/gin&quot;.HandlerFunc) as type &quot;github.com/supebirdgz/amgmt/vendor/github.com/gin-gonic/gin&quot;.HandlerFunc in argument to router.Use
  </code></pre>
  <p>source:</p>
  <pre><code>import (
      &quot;github.com/gin-gonic/gin&quot;
      &quot;github.com/gin-gonic/contrib/static&quot;
  )
  
  func main()  {
      router := gin.Default()
      router.Use(static.Serve(&quot;/&quot;, static.LocalFile(&quot;./frontend&quot;, true)))
      router.Run()
  }
  </code></pre>
  <p>Was something updated in Gin? I tried replacing static package with others, still the same.</p>