Electron JS/Node JS desktop app as a local network webserver
Asked Answered
C

1

7

Is it possible to make an Electron JS desktop app that is a web server, so that when we start the app the server will also start and we can access it from other computer within the same network/LAN?

Cohn answered 2/10, 2018 at 7:26 Comment(4)
Why not? HTTP is a native module in NodeJS so you can import in electron with no problem. Have you tried something?Neeley
I have made a server with node js and will implement a express js web app. I am thinking to make Electron app for installing the server(with node js and my express app/dependency install) in the system and when user will start the electron app the server will start and other system can access it with browser. But I am not sure about It will allow users to access there Printer/Scanner/Barcode Scanner through web browser. Any idea?Cohn
Any luck with this @Shashank, I am trying to do something similar too. Not sure if something like "make an electron app accessible over LAN" is possible.Iceblink
@BkBaba, yes I have developed it successfully, I have made an Electron desktop app which starting a server in system (LAN) and inside it I am using Express for API. And I have made a client side desktop app in electron which is calling server API's. Also for making system IP(server) static I have made entry in router with system(server) mac address to allot it static IP.Cohn
H
0

Yes, it is.

Yout can run you server (express or just bare http/https/http2) on main process.

Also you can child_process.fork() or child_process.spawn(). It works fine.

Horgan answered 8/8, 2020 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.