2019-08-16 15:57:03 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-10-25 00:27:02 +02:00
|
|
|
"github.com/kataras/iris/v12"
|
2019-08-16 15:57:03 +02:00
|
|
|
|
|
|
|
"github.com/iris-contrib/middleware/newrelic"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := iris.New()
|
|
|
|
config := newrelic.Config("APP_SERVER_NAME", "NEWRELIC_LICENSE_KEY")
|
|
|
|
config.Enabled = true
|
|
|
|
m, err := newrelic.New(config)
|
|
|
|
if err != nil {
|
|
|
|
app.Logger().Fatal(err)
|
|
|
|
}
|
|
|
|
app.Use(m.ServeHTTP)
|
|
|
|
|
|
|
|
app.Get("/", func(ctx iris.Context) {
|
|
|
|
ctx.Writef("success!\n")
|
|
|
|
})
|
|
|
|
|
2020-03-05 21:41:27 +01:00
|
|
|
app.Listen(":8080")
|
2019-08-16 15:57:03 +02:00
|
|
|
}
|