Tag: static files

  • One-liner for serving static files in Go explained

    Whenever I want to set up a server for serving static files in Go, which is not often, I always have to spend some time to figure out the following one-liner. http.Handle(“/images/”, http.StripPrefix(“/images/”, http.FileServer(http.Dir(“./images”)))) What confuses me probably the most here is all three strings being practically the same. So in this post I will…

  • Serving Node application in production

    When we want to serve our Node app in production and with best performance, we need to minimize our static files (javascript, stylesheets, images,…), setup Nginx for serving those static files/proxying requests to our application server and installing process manager that will keep our application alive in case of crashes. Minimizing our static files is…