Skip to content

Instantly share code, notes, and snippets.

@danjac
Created August 11, 2015 20:35
Show Gist options
  • Save danjac/3c8220f19bbf65ec2029 to your computer and use it in GitHub Desktop.
Save danjac/3c8220f19bbf65ec2029 to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
proxyURL, _ := url.Parse("http://localhost:8000")
http.Handle("/", httputil.NewSingleHostReverseProxy(proxyURL))
http.Handle("/media/", http.StripPrefix("/media/", http.FileServer(http.Dir("./django_caf/media"))))
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./django_caf/static"))))
http.ListenAndServe(":9000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment