Created
January 15, 2018 22:41
-
-
Save sinnlosername/9904ea8aaf7113ef1e365309b0b465b1 to your computer and use it in GitHub Desktop.
Small testserver which serves the correct directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"os" | |
"path/filepath" | |
) | |
const listen = "127.0.0.1:1337" | |
func main() { | |
dir, _ := filepath.Abs(filepath.Dir(os.Args[0])) | |
println("Serving: " + dir + " at " + listen + "/") | |
http.ListenAndServe(listen, http.FileServer(http.Dir(dir))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment