0

我正在为 twitter 开发一个电报机器人,源代码在 github https://github.com/chenxsan/telegram-bot-for-twitter上开源。但我想通过隐藏它来保护 webhook,所以我正在从配置中读取 webhook:

scope "/api", TweetBotWeb do
    pipe_through :api
    post "/#{Application.get_env(:tweet_bot, :webhook)}", TwitterController, :index
  end

prod.secret.exs

config :tweet_bot, webhook: "${WEBHOOK}"

但是在使用https://github.com/bitwalker/distillery/构建后,该版本不会WEBHOOK从 env 中读取,所以我只是收到 404 错误。

是否可以在 PhoenixFramework 中做到这一点?如果是,我该怎么做?

4

0 回答 0