package main
import (
"net/http"
"path"
)
func main() {
http.HandleFunc("/", fotografia)
http.ListenAndServe(":8080", nil)
}
func fotografia(w http.ResponseWriter, r *http.Request) {
fp := path.Join("images", "foto.jpg")
http.ServeFile(w, r, fp)
}
I> Në folderin images, e vendosim një fajll me emrin foto.jpg.
Duke e hapur adresën:
do të shfaqet fotografia e cekur.