diff options
| author | horus_arch | 2015-04-21 01:47:42 +0200 |
|---|---|---|
| committer | horus_arch | 2015-04-21 01:47:42 +0200 |
| commit | b3fa125ed0292f8ca37e91bf19c8cae7cdacc506 (patch) | |
| tree | 61079b97ed26bf4c9483eb14dee7205c3c349b90 /server/server.go | |
| parent | 01e9a34952bd6ddd383680b0ca2312e476ad07a6 (diff) | |
| download | mandible-b3fa125ed0292f8ca37e91bf19c8cae7cdacc506.tar.gz | |
Add API documentation and better defaults.
Diffstat (limited to 'server/server.go')
| -rw-r--r-- | server/server.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go index 4cfafe7..e55d2e1 100644 --- a/server/server.go +++ b/server/server.go @@ -194,7 +194,10 @@ func (s *Server) Start() { apiHandler := func(w http.ResponseWriter, r *http.Request) { templ := mainTempl.Lookup("api.html") - err := templ.ExecuteTemplate(w, "api.html", nil) + err := templ.ExecuteTemplate(w, "api.html", struct { + OriginUrl string + ResponseUrl string + }{os.Getenv("ORIGIN_URL"), os.Getenv("UPLOAD_URL")}) if err != nil { ErrorResponse(w, err.Error(), http.StatusInternalServerError) return @@ -231,7 +234,7 @@ func (s *Server) Start() { port = fmt.Sprintf(":%d", s.Config.Port) } - http.ListenAndServe(port, nil) + log.Panic(http.ListenAndServe(port, nil)) } func (s *Server) download(url string) (io.ReadCloser, error) { |
