【问题标题】:ngrok + stripe webhook for multi-tenant application (subdomains)用于多租户应用程序(子域)的 ngrok + stripe webhook
【发布时间】:2019-02-06 18:14:26
【问题描述】:

我目前正在测试一个多租户应用程序。当用户注册帐户时,会为该帐户创建一个子域。成功创建后,会发生以下过​​程:

帐户管理员

def create
    @account = Account.new(account_params)
    if @account.save
      sign_in(@account.owner)
      flash[:notice] = "Your account has been created."
      redirect_to root_url(subdomain: @account.subdomain)
    else
      flash.now[:alert] = "Sorry, your account could not be created."
      render :new
    end
  end

用户被重定向到他们的帐户,网址现在是 subdomain.url.com

上述方法在开发中与 lvh.me 配合使用非常好,但是当我使用 ngrok 进行测试时 - 用于测试条带式网络书 - 我的 ngrok 隧道地址与正在设置的子域冲突。

我的条纹电子书看起来像这样: https://3abg89zc.ngrok.io/webhooks/stripe

创建帐户后,我的网址转到:https://subdomain.ngrok.io/

【问题讨论】:

    标签: ruby-on-rails devise stripe-payments multi-tenant


    【解决方案1】:

    我相信这里的答案可能有效: How can I access a subdomain through ngrok?

    但是,我发现使用 heroku 在实时环境中进行测试更容易。

    【讨论】:

      猜你喜欢
      • 2016-05-31
      • 2018-11-17
      • 1970-01-01
      • 2016-10-01
      • 1970-01-01
      • 2021-06-14
      • 1970-01-01
      • 2021-08-08
      • 1970-01-01
      相关资源
      最近更新 更多