Created
July 27, 2015 16:20
-
-
Save jpoehls/a40db92ad2033ab7316f to your computer and use it in GitHub Desktop.
Revisions
-
jpoehls created this gist
Jul 27, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # Caddyfile localhost:2015 { startup "go run ./server.go" & root ./static_files proxy / localhost:2016 } # FILE TREE # # │ Caddyfile # │ server.go # │ # └───static_files # styles.css This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ // server.go package main import ( "fmt" "log" "net/http" ) func main() { http.HandleFunc("/", handler) log.Fatalln(http.ListenAndServe(":2016", nil)) } func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, ` <html> <head> <link href="/styles.css" rel="stylesheet" /> </head> <body> My background should be blue. </body> </html> `) } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ /* static_files/styles.css */ body { background-color: blue; }