Last active
August 29, 2015 14:12
-
-
Save wadewegner/52a925a7b1607a48d796 to your computer and use it in GitHub Desktop.
Files for post "Running Go in Azure Websites in 4 Simple Steps"
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 ( | |
"fmt" | |
"net/http" | |
"os" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "You just browsed page (if blank you're at the root): %s", r.URL.Path[1:]) | |
} | |
func main() { | |
http.HandleFunc("/", handler) | |
http.ListenAndServe(":"+os.Getenv("HTTP_PLATFORM_PORT"), nil) | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> | |
</handlers> | |
<httpPlatform processPath="d:\home\site\wwwroot\go\bin\go.exe" | |
arguments="run d:\home\site\wwwroot\server.go" | |
startupTimeLimit="60"> | |
<environmentVariables> | |
<environmentVariable name="GOROOT" value="d:\home\site\wwwroot\go" /> | |
</environmentVariables> | |
</httpPlatform> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment