LoginSignup
5
4

More than 5 years have passed since last update.

Powで起動しているRailsアプリケーションをngrokで外部に公開する

Posted at

ngrok 2.0系の場合

インストール方法

公式サイトからバイナリをダウンロードして設置する。
/usr/local/binあたりに設置すると良いかも。

実行方法

ngrok http -host-header=myapp.dev 80

-host-headerに公開したいアプリケーションのURLを指定するのが肝。例はPowでmyappを登録している場合。

こっちの方がオススメ!

ngrok 1.7系の場合

インストール方法

brew install ngrok

設定

  1. ~/.powconfigexport POW_EXT_DOMAINS=ngrok.comを追加
  2. powの再起動

実行方法

ngrok -subdomain=myapp myapp.dev:80

どちらの方法でも生成されたURLにスマホ等からアクセスすれば、Powで起動しているRailsアプリケーションに接続出来ます。簡単ですね!

参考

ngrok - secure introspectable tunnels to localhost
Using ngrok with Pow for Development Previews | Bunker

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4