Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7290f8

Browse files
authored
Merge pull requestcoderoad#203 from ShMcK/cleanup-env
remove sentry DSN
2 parentsc66f60d +91ded20 commitc7290f8

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

‎src/environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ interface Environment {
77
NODE_ENV:string
88
LOG:boolean
99
API_URL:string
10+
SENTRY_DSN:string|null
1011
}
1112

1213
constenvironment:Environment={
1314
VERSION:process.env.VERSION||'unknown',
1415
NODE_ENV:process.env.NODE_ENV||'production',
1516
LOG:(process.env.LOG||'').toLowerCase()==='true',
1617
API_URL:process.env.REACT_APP_GQL_URI||'',
18+
SENTRY_DSN:process.env.SENTRY_DSN||null,
1719
}
1820

1921
exportdefaultenvironment

‎src/services/sentry/init.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import{init}from'@sentry/node'
22
importenvironmentfrom'../../environment'
33

4-
init({
5-
dsn:'https://df4a6ae19e8b44ed9a87ae4432dab9df@sentry.io/1889368',
6-
environment:environment.NODE_ENV,
7-
})
4+
if(environment.SENTRY_DSN){
5+
init({
6+
dsn:environment.SENTRY_DSN,
7+
environment:environment.NODE_ENV,
8+
})
9+
}

‎web-app/src/environment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ export const VERSION: string = process.env.VERSION || 'unknown'
1111
exportconstNODE_ENV:string=process.env.NODE_ENV||'development'
1212
exportconstLOG_STATE:boolean=(process.env.REACT_APP_LOG_STATE||'').toLowerCase()==='true'
1313
exportconstTUTORIAL_LIST_URL:string=process.env.REACT_APP_TUTORIAL_LIST_URL||''
14+
exportconstSENTRY_DSN:string|null=process.env.REACT_APP_SENTRY_DSN||null

‎web-app/src/services/sentry/init.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import*assentryfrom'@sentry/browser'
2-
import{NODE_ENV}from'../../environment'
2+
import{NODE_ENV,SENTRY_DSN}from'../../environment'
33

44
try{
5-
sentry.init({
6-
dsn:'https://701cee76c32a4408b2fcb6af3e139d46@sentry.io/1889371',
7-
environment:NODE_ENV,
8-
})
5+
if(SENTRY_DSN){
6+
sentry.init({
7+
dsn:SENTRY_DSN,
8+
environment:NODE_ENV,
9+
})
10+
}
911
}catch(error){
1012
console.log('Error in Sentry init')
1113
console.log(error)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp