greggman / servez

A simple web server for local web development.
https://greggman.github.io/servez/
295 stars 48 forks source link

Display a QR code #12

Closed larryw3i closed 2 years ago

larryw3i commented 2 years ago

You forgot one thing: qrcode. @greggman

greggman commented 2 years ago

not a bad idea. Unfortunately I have no idea what code to generate. I can generate http://<your-up-address>:<port> but that assumes the page you want to go to is at the root document. For me, that's almost never true but maybe it is for others?

larryw3i commented 2 years ago

@greggman Print QR code of url in the terminal, and then if the mobile phone and the computer are on the same LAN, the mobile phone can scan the code and browse the files, I think it's quite convenient.

larryw3i commented 2 years ago

servez is perfect, I want to contribute. Unfortunately, I haven't nodejs development experience.😂

greggman commented 2 years ago

Are you using the node version or the Electron version?

greggman commented 2 years ago

To put it another way, are you using the command line version of servez or the app version?

larryw3i commented 2 years ago

To put it another way, are you using the command line version of servez or the app version?

Yes, I use cli version.

greggman commented 2 years ago

ok then, update to the latest and use servez --qr

larryw3i commented 2 years ago

Extremely amazing!

larryw3i commented 2 years ago

In fact, using the mobile version of Firefox browser can not recognize the QR code, I think this QR code should be square.
Screenshot from 2022-02-28 20-07-53

greggman commented 2 years ago

you can try the latest but to be honest there is no way to guarantee a square image in the terminal since it's up to the user to select a font.

synthic commented 2 years ago

Just a note, QR codes require a white margin around them to be readable by most apps.