File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1515'use strict' ;
1616
1717// [START functions_slack_setup]
18- const config = require ( './config.json' ) ;
1918const { google} = require ( 'googleapis' ) ;
2019const { verifyRequestSignature} = require ( '@slack/events-api' ) ;
2120
@@ -94,7 +93,7 @@ const formatSlackMessage = (query, response) => {
9493 */
9594const verifyWebhook = ( req ) => {
9695 const signature = {
97- signingSecret : config . SLACK_SECRET ,
96+ signingSecret : process . env . SLACK_SECRET ,
9897 requestSignature : req . headers [ 'x-slack-signature' ] ,
9998 requestTimestamp : req . headers [ 'x-slack-request-timestamp' ] ,
10099 body : req . rawBody ,
@@ -118,7 +117,7 @@ const makeSearchRequest = (query) => {
118117 return new Promise ( ( resolve , reject ) => {
119118 kgsearch . entities . search (
120119 {
121- auth : config . KG_API_KEY ,
120+ auth : process . env . KG_API_KEY ,
122121 query : query ,
123122 limit : 1 ,
124123 } ,
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ const getSample = () => {
4343 return {
4444 program : proxyquire ( '../' , {
4545 googleapis : { google : googleapis } ,
46- './config.json' : config ,
46+ process : { env : config } ,
4747 '@slack/events-api' : eventsApi ,
4848 } ) ,
4949 mocks : {
You can’t perform that action at this time.
0 commit comments