Added option to enable pprof.
This commit is contained in:
@@ -50,7 +50,8 @@ $ go install github.com/dimiro1/ipe
|
||||
```javascript
|
||||
{
|
||||
"Host": ":8080", // Required
|
||||
"SSL": false, // Required but can be false
|
||||
"SSL": false, // Not Required, default is false
|
||||
"Profiling": false, // Mount pprof at /debug. Not Required, default is false
|
||||
"SSLHost": ":4433", // Required if SSL is true
|
||||
"SSLKeyFile": "A key.pem file", // Required if SSL is true
|
||||
"SSLCertFile": "A cert.pem file", // Required if SSL is true
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"Host": ":8080",
|
||||
"Encrypted": false,
|
||||
"SSL": false,
|
||||
"Profiling": true,
|
||||
"SSLHost": ":8090",
|
||||
"SSLKeyFile": "key.pem",
|
||||
"SSLCertFile": "cert.pem",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"Host": ":8080",
|
||||
"SSL": false,
|
||||
"Profiling": false,
|
||||
"SSLHost": ":4433",
|
||||
"SSLKeyFile": "A key.pem file",
|
||||
"SSLCertFile": "A cert.pem file",
|
||||
|
||||
@@ -9,6 +9,7 @@ type configFile struct {
|
||||
Host string // The host, eg: :8080 will start on 0.0.0.0:8080
|
||||
User string
|
||||
SSL bool
|
||||
Profiling bool
|
||||
SSLHost string
|
||||
SSLKeyFile string
|
||||
SSLCertFile string
|
||||
|
||||
@@ -59,6 +59,10 @@ func Start(filename string) {
|
||||
r.Get("/apps/:app_id/channels/:channel_name/users", (&getChannelUsersHandler{db}).ServeHTTP)
|
||||
})
|
||||
|
||||
if conf.Profiling {
|
||||
r.Mount("/debug", middleware.Profiler())
|
||||
}
|
||||
|
||||
if conf.SSL {
|
||||
go func() {
|
||||
log.Infof("Starting HTTPS service on %s ...", conf.SSLHost)
|
||||
|
||||
Reference in New Issue
Block a user