Share a local Vite dev server
#

Expose gives your Vite dev server a public HTTPS URL, so you can open your React, Vue or Svelte app on another device or show it to someone else.

1. Start Vite and share it
#

npm run dev

Vite listens on port 5173 by default. In a second terminal:

expose share http://localhost:5173

2. Allow the Expose host
#

Vite only answers requests for hostnames it knows. If the shared URL shows "Blocked request. This host is not allowed.", add the Expose domain to server.allowedHosts in vite.config.js:

export default {
  server: {
    allowedHosts: ['.sharedwithexpose.com'],
  },
}

The leading dot allows every subdomain. If you use your own custom domain, allow that instead.

3. Laravel, Herd and Vite
#

If Vite runs next to a Laravel site, you don't need to share Vite yourself. Share the site, and Expose detects the running Vite process, shares it too, and rewrites the page so CSS, JavaScript and hot reloading work through the tunnel:

expose share my-app.test

Other ways to share
#

  • Only on your Wi-Fi: add --lan to share on the local network with a QR code, without an account. See Local Network Sharing.
  • The same URL every time: add --subdomain=my-app with Expose Pro.