Preact-cli: Idea: Expose development server to network interface

Created on 1 Jul 2017  Â·  4Comments  Â·  Source: preactjs/preact-cli

Is it possible to expose the development server to the network interface? This would make it very easy for someone to access his preact app on his phone without having to fiddle around with simulators.

This already works in create-react-app:

$ yarn start
Compiled successfully!

You can now view test in the browser.

Local: http://localhost:3000/
On Your Network: http://192.168.2.104:3000/

Note that the development build is not optimized.
To create a production build, use yarn build.

If such a feature already exists, how do I enable it?

Most helpful comment

@thangngoc89 leave it to me, I'll do it

All 4 comments

It's already available, just our start output doesn't show the public network address. Seems like a useful feature.

Must have had a typo then in the URL on my smartphone – my mistake! Yes adding that info to the npm start
output would be useful

I'm on mobile but it's 2 lines away:

var ip = require("ip");
console.dir ( ip.address() );

@thangngoc89 leave it to me, I'll do it

Was this page helpful?
0 / 5 - 0 ratings