mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-02 17:09:48 +02:00
Deploy to Heroku without custom buildpack
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
@@ -96,6 +97,10 @@ func init() {
|
||||
saltpath := flag.String("saltpath", "", "path of the file with hex-encoded salt")
|
||||
flag.Parse()
|
||||
|
||||
if port := os.Getenv("PORT"); len(port) > 0 {
|
||||
conf.Bind = fmt.Sprintf(":%s", port)
|
||||
}
|
||||
|
||||
strEnvConfig(&conf.Bind, "IMGPROXY_BIND")
|
||||
intEnvConfig(&conf.ReadTimeout, "IMGPROXY_READ_TIMEOUT")
|
||||
intEnvConfig(&conf.WriteTimeout, "IMGPROXY_WRITE_TIMEOUT")
|
||||
|
Reference in New Issue
Block a user