0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Laravel】自分のiPhoneでローカル環境を確認する方法

Posted at

自分のiPhoneでローカル環境を確認する方法

viteの設定を変更する

serverのhostをtrueにする

export default defineConfig({
    ~~~
    server: {
        host: true,
        ~~~
    },
});

--hostをつけて開発環境立ち上げ

npm run dev --host
Port 5173 is in use, trying another one...

  VITE v5.0.12  ready in 118 ms

  ➜  Local:   http://localhost:5174/
  ➜  Network: http://192.168.11.3:5174/
  ➜  press h + enter to show help

  LARAVEL v10.43.0  plugin v1.0.1

  ➜  APP_URL: http://localhost

これだけ!

接続できない場合は

  • iPhoneとPCが別のネットワーク(wifi)に繋がってる可能性
  • iPhoneのネットワーク設定を変更すれば解決するかも!
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?