diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-08-15 18:10:19 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-08-15 18:10:19 +0300 |
| commit | f1798f570d645c5148908461064e402baadd2ed1 (patch) | |
| tree | 9990b4c94a406d712b50f10e9d53dab63696f9f1 /backend/main.go | |
| parent | chore: frontend package stuff (diff) | |
| parent | feat/backend: add newrelic integration (#274) (diff) | |
| download | lphub-f1798f570d645c5148908461064e402baadd2ed1.tar.gz lphub-f1798f570d645c5148908461064e402baadd2ed1.tar.bz2 lphub-f1798f570d645c5148908461064e402baadd2ed1.zip | |
feat/frontend: update tailwind to main branch
Diffstat (limited to 'backend/main.go')
| -rw-r--r-- | backend/main.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/main.go b/backend/main.go index a1a4a20..e422359 100644 --- a/backend/main.go +++ b/backend/main.go | |||
| @@ -11,6 +11,8 @@ import ( | |||
| 11 | 11 | ||
| 12 | "github.com/gin-gonic/gin" | 12 | "github.com/gin-gonic/gin" |
| 13 | "github.com/joho/godotenv" | 13 | "github.com/joho/godotenv" |
| 14 | nrgin "github.com/newrelic/go-agent/v3/integrations/nrgin" | ||
| 15 | "github.com/newrelic/go-agent/v3/newrelic" | ||
| 14 | ) | 16 | ) |
| 15 | 17 | ||
| 16 | // @title Least Portals Hub | 18 | // @title Least Portals Hub |
| @@ -30,7 +32,16 @@ func main() { | |||
| 30 | if os.Getenv("ENV") == "PROD" { | 32 | if os.Getenv("ENV") == "PROD" { |
| 31 | gin.SetMode(gin.ReleaseMode) | 33 | gin.SetMode(gin.ReleaseMode) |
| 32 | } | 34 | } |
| 35 | app, err := newrelic.NewApplication( | ||
| 36 | newrelic.ConfigAppName("lphub"), | ||
| 37 | newrelic.ConfigLicense(os.Getenv("NEWRELIC_LICENSE_KEY")), | ||
| 38 | newrelic.ConfigAppLogForwardingEnabled(true), | ||
| 39 | ) | ||
| 40 | if err != nil { | ||
| 41 | log.Fatal("Error instrumenting newrelic") | ||
| 42 | } | ||
| 33 | router := gin.Default() | 43 | router := gin.Default() |
| 44 | router.Use(nrgin.Middleware(app)) | ||
| 34 | database.ConnectDB() | 45 | database.ConnectDB() |
| 35 | api.InitRoutes(router) | 46 | api.InitRoutes(router) |
| 36 | // for debugging | 47 | // for debugging |