Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Commit 1cc7cf2

Browse files
authored
fix(handlers.js): handle env vars correctly (#94)
1 parent c2e733d commit 1cc7cf2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/handlers.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ const WRAPPER_CODE = ({
1818
}) => {
1919
const commonNode = `
2020
21+
if (!process.env.EPSAGON_IGNORED_KEYS) {
22+
process.env.EPSAGON_IGNORED_KEYS = "${ignoredKeys || ''}";
23+
}
24+
25+
if (!process.env.EPSAGON_URLS_TO_IGNORE) {
26+
process.env.EPSAGON_URLS_TO_IGNORE = "${urlsToIgnore || ''}";
27+
}
28+
2129
epsagon.init({
2230
token: '${token}',
2331
appName: '${appName}',
2432
traceCollectorURL: ${collectorUrl},
2533
metadataOnly: Boolean(${metadataOnly}),
2634
labels: ${labels || '[]'},
27-
urlPatternsToIgnore: ${urlsToIgnore ? "['".concat(urlsToIgnore.replace(',', "', '")).concat("']") : '[]'},
28-
ignoredKeys: ${ignoredKeys ? "['".concat(ignoredKeys.replace(',', "', '")).concat("']") : '[]'},
2935
});`;
3036

3137
return ({

0 commit comments

Comments
 (0)