Build Electron as http server

Asked

Viewed 233 times

2

I wonder if there is any possibility to compile the Electron and Executable open the files as HTTP server instead of running them as file:// I am trying to access a web page that does not accept request for domains file:// so I need mine. EXE run the files as http:// it is possible to compile Electron as if it were running in Dev ?

  • Do you have Node.js? You could mount a simple server with Node. Simpler.

  • I need it to be via Electron pq mount Node server on the user at the time of running it would mto work.

  • 1

    @Sergio Electron has built-in Node. It’s simply a matter of starting a server, and the other side of Electron accessing. Gabriel, to my knowledge, Electron does not restrict the protocol to file://, can use http:// if this points to an existing resource (be served by the internal Node of Electron, be an external website).

  • @bfavaretto interesting, use the eletron for end-to-end testing, but never used alone so.

  • @bfavaretto then, in case the files are compiled into one . asar and at the time I will run the EXE generated by Packer it accesses the files as file:// and as I did not want Electron to access an external Node on the web (to avoid server cost) I wanted to know if I can run the Electron dev environment (usually creates an http server) in production.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.