


Yes, you can pry, but only if you could not remember. Next, try to answer the questions and do the exercises in order to better consolidate the material. Separate 10–15 minutes and the read text restored in memory and the studied code from articles. Now you know a lot more than 15 minutes ago. ├── main.go └── templates ├── admin │ └── index.html └── index.html Suppose we have the following project directory structure: tree. Please note, we are working with the packr v1 branch. It is he who will allow us to pack all the necessary files into one binary file. static/images/photos so that it is available at : http.Handle("/photos", http.FileServer("./static/images/photos")) gobuffalo/packr That is, the http.FileServer() function allows you to mount a folder to any specified address (route) of the web server.įor example, mount the root folder. This function is the key and gives the web server full access to the specified folder and all its files. It is interesting to us, as it is very easy to understand, has good documentation and has the function http.FileServer().įor more details, see official documentation. Included in the standard Go delivery and does not require separate installation and configuration. net/httpĪ package that provides an implementation of the HTTP client and server. To better understand what is happening, I suggest you examine the work of some of the packages on which we will rely and use.
