-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds some WebClient options #278
Conversation
Codecov Report
@@ Coverage Diff @@
## master #278 +/- ##
==========================================
+ Coverage 72.48% 72.65% +0.16%
==========================================
Files 7 7
Lines 498 501 +3
Branches 138 142 +4
==========================================
+ Hits 361 364 +3
Misses 105 105
Partials 32 32
Continue to review full report at Codecov.
|
}: ExpressReceiverOptions) { | ||
super(); | ||
|
||
this.app = express(); | ||
this.app.use(this.errorHandler.bind(this)); | ||
// TODO: what about starting an https server instead of http? what about other options to create the server? | ||
this.server = createServer(this.app); | ||
this.axios = axios.create(Object.assign( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I overlooked the necessity to support the respond
function as well. Great catch 🙇
Hi, is the custom logger passed to the WebClient? I see the pull request has been merged but it doesn't seem to be in the package |
@seblaz 👋 Can you try version |
Hi @seratch, I'm using the latest version (2.0.0). I dig a little and found that this feature (using a custom logger in the WebClient) was removed in commit 1428ec3. I feel that this has been discused before, but why did you chose to remove it? I would find it useful to use a custom logger in the WebClient. |
@seblaz Another minor reason is to have different names among a Bolt app itself and I've changed the behavior before but I'm positive to revisit this. There are two solutions.
Both look fine to me but I prefer Solution 2) as it enables developers to take control of logging much more. What do you think? @aoberoi @stevengill |
I also prefer Solution 2. I think the name separation is a meaningful advantage. Similarly, I think its a bit odd that the name of the |
This sounds nice to me! @aoberoi |
@seratch i prefer a different name. in my opinion the point of the logger is for tracing and understand which parts of the code are run. so putting a name that matches with the filename is actually what i would prefer. for example, i would change Also, if we provide a new option for specifying the |
@aoberoi |
why not |
Because `bolt-app` isn’t a clear reference to the class name or file name
`App`.
I agree that App on its own feels generic. How about a shorter prefix?
`bolt:App:{instanceId}`
As for consistency, maybe in the future we could add a prefix (such as
`web-api`) for the node-slack-sdk packages.
This should also be a little less verbose. @seratch: what do you think?
On Thu, Apr 16, 2020 at 11:43 AM Steve Gill ***@***.***> wrote:
why not bolt-app and ExpressReceiver. App seems a little generic on its
own
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#278 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADYZS4MDIZSQAUPJWUR2QTRM5GTPANCNFSM4I5UTFAQ>
.
--
Ankur Oberoi
Developer Relations Manager, Developer Tools Lead | Slack
@aoberoi (github <https://github.com/aoberoi>, facebook
<https://facebook.com/aoberoi>, twitter <https://twitter.com/aoberoi>)
|
@aoberoi I like the idea. I've created a task on the node-slack-sdk side: slackapi/node-slack-sdk#995 |
On the node-slack-sdk side, @stevengill created a fix slackapi/node-slack-sdk#999 for slackapi/node-slack-sdk#995 |
Summary
This PR adds the following options to the
App
constructor:agent
: Allows users to set a custom HTTP agent, which is most often used for setting up proxy support. Will affect both the client HTTP requests made from theWebClient
and theExpressReceiver
(if the default receiver is used).clientTls
: Allows users to set a custom TLS configuration for HTTP client requests. This is most often used to send requests to a specific Slack environment (internal usage). Will affect both the client HTTP requests made from theWebClient
and theExpressReceiver
(if the default receiver is used).clientOptions.slackApiUrl
: Allows users to set a custom endpoint for the Slack API. This is most often used for testing as well as sending requests to a specific Slack environment (internal usage). This only affects theWebClient
.It also changes the behavior of the
logger
option to also affect theWebClient
.Fixes #221
Requirements (place an
x
in each[ ]
)