Skip to content

Instantly share code, notes, and snippets.

@malikbenkirane
Last active April 8, 2019 06:52
Show Gist options
  • Save malikbenkirane/6df8b39f39511205e58a132210b260ed to your computer and use it in GitHub Desktop.
Save malikbenkirane/6df8b39f39511205e58a132210b260ed to your computer and use it in GitHub Desktop.
go simple static -web-server
/* https://golang.org/pkg/net/http/#example_FileServer */
package main
import (
"log"
"net/http"
)
func main() {
// Simple static webserver:
log.Fatal(http.ListenAndServe(":8080", http.FileServer(http.Dir("/usr/share/doc"))))
}
@malikbenkirane
Copy link
Author

change ":8080" with whatever

@malikbenkirane
Copy link
Author

change "/usr/share/doc" with whatever too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment