Using a is great when passing off incoming requests to functions to handle and return data. Often though, you just want to an entire directory and make everything inside it public. This is useful for images, styles and javascript.
In this example we’re using the Gorilla router (“HTTP request multiplexer”) and setup a new route for the entire directory. We’re using as the folder to serve which we pass to FileServer() as a new route on the router.

Source link


Please enter your comment!
Please enter your name here