LoginSignup
8
8

More than 5 years have passed since last update.

grunt serveでlocalhost以外のドメインからアクセスする方法

Posted at

Gruntfile.jsを修正する。

hostname: 'localhost'と記載のある箇所を、hostname: '0.0.0.0'へと修正する。

        connect: {
            options: {
                port: 9000,
                open: true,
                livereload: 35729,
                // Change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },

この対応を入れてみて

自分のiPhoneなどの端末からアクセスできる様になったので、随分と開発が楽になったような気がしました♩

8
8
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
8
8