2015-08-25 45 views
6

我已經在本地運行slackbox,創建了Spotify開發應用程序併成功驗證了slackbox。它說我登錄在http://localhost:5000/。我的所有變量都已設置,包括鬆弛的記號,通過dotenv在.env文件中。Slackbox - 無法檢索到所請求的URL - 拒絕訪問

一切似乎都很好。

在閒置的一面,我創建了一個斜槓命令映射到/ spotify POST到http://localhost:5000/store。打字時,斜槓命令顯示在我的命令描述列表中。

當我嘗試,雖然使用它,我在聊天中收到拒絕訪問消息,我假設由於跨域問題:

錯誤:所請求的網址無法獲取

拒絕訪問。

根據他們的文檔 - https://github.com/benchmarkstudios/slackbox - 在本地運行應該工作。我也在本地運行Hubot機器人,它與同一個閒置房間整合良好。

任何幫助表示讚賞!

回答

5

https://sprint.ly/blog/5-steps-to-a-slack-integration/

Slack’s outgoing slash command requests need to be sent to a public facing url, which is a problem if we want to receive these messages to our local development server.

How do we solve this?

One way is with the use of a secure tunnel which acts as a public HTTPS URL for our local development server. Problem solved!

Who provides this service?

ForwardHQ provide the best user experience, including a browser extension for setting up a local tunnel in one click. They have a free 7 day trial.

My preferred option is ngrok. It’s free for one concurrent tunnel client, with no time restriction. Woop! Its a little harder to use but it does the job.