Skip to main content
100%

Serve static file with golang

✓ Published0🌍 Public
Aadkdev
Last edited Sep 24, 2015
Created on Sep 24, 2015

This example demonstrates a minimal Go web server that serves static files from a local directory. It uses the `net/http` package’s `FileServer` handler to map the root URL path to the folder `D:/dev/static`, while `http.ListenAndServe` binds the server to port 5555. The code also logs a startup message via the `log` package. No dynamic data processing or client-side visualization is involved; the server simply delivers any requested file (HTML, images, etc.) over HTTP.

AI-generated description

Similar vizzes