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