Skip to content

Instantly share code, notes, and snippets.

@harrifeng
Created November 8, 2018 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harrifeng/bf5576f6c0537f57ef5b84fa19b87fc0 to your computer and use it in GitHub Desktop.
Save harrifeng/bf5576f6c0537f57ef5b84fa19b87fc0 to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"os"
)
func main() {
shareFolder := "/share"
if len(os.Args) > 1 {
shareFolder = os.Args[1]
}
http.ListenAndServe(":8081", http.FileServer(http.Dir(shareFolder)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment