Over the past two weeks, I have made great progress in Go. I implemented a small program that accepts user input and displays ASCII art on a webpage. What I learned from this project is that it can be embedded on the web to display blurred images.
The interesting part was implementing a mapping server to GET static files from the static directory:
fs := http.FileServer(http.Dir("static"))
This line handles the GET requests by mapping CSS to the Go backend. It is implemented at the top of main.go, followed by this line:
http.Handle("/static/", http.StripPrefix("/static/", fs))
I enjoy using HTML and CSS to create nice-looking webpages.
follow the link to get the whole code: https://github.com/ckotugeh/ascii-art-webs
Top comments (0)