Expose gives your Next.js dev server a public HTTPS URL, so you can receive webhooks in route handlers, test on a real phone, or send a preview to someone else.
npm run dev
Next.js listens on port 3000 by default. In a second terminal:
expose share http://localhost:3000
Open the URL Expose prints. With Expose Pro, add --subdomain=my-app for a URL that stays the same.
Recent Next.js versions block cross-origin requests to dev-only resources such as hot reloading. If the page loads but doesn't update, or the terminal shows a blocked cross-origin request warning, add your Expose host to allowedDevOrigins in next.config.js:
module.exports = {
allowedDevOrigins: ['*.sharedwithexpose.com'],
}
Restart the dev server after changing the config.
Some settings must contain the public URL instead of localhost while you share the app:
NEXTAUTH_URL or AUTH_URL, and the callback URL registered with your OAuth provider. See OAuth callbacks on localhost./api/webhooks/stripe. See Stripe webhooks.The Expose dashboard at http://127.0.0.1:4040 lists every request to your app with headers, body and response, and can replay a request to a route handler.
expose share http://localhost:3000 --lan gives phones and colleagues on the same network a URL and a QR code, without an account. See Local Network Sharing.--basicAuth="user:secret". See Password Protection.