Nativefier: dynamic url port

Created on 19 Aug 2020  路  3Comments  路  Source: jiahaog/nativefier

I'm using nativefiyer to create the front end for a desktop app which is run from a local server. I'd like the port its served on to be randomly determined with I start it, how can I pass that to electron so that it can point to the correct url?
My server is running off of python quart, not that it would make much difference, but I start the server and then start electron. closing electron signals that I can kill the server
thanks

question

Most helpful comment

Fare enough, thanks for keeping nativefier working, its a great app,

All 3 comments

would love to see an official option for this, but at the moment I am creating the app using localhost and then using sed to replace options.targetUrl with "http://localhost:"+porcess.env.port. obviously I am setting the environment variable before starting app. Works on linux (arch specifically) going to see how it works on windows

would love to see an official option for this, but at the moment I am creating the app using localhost and then using sed to replace options.targetUrl with "http://localhost:"+porcess.env.port. obviously I am setting the environment variable before starting app

@jjgalvez 馃憤, this seems totally reasonable, as your server has knowledge of A. the port, and B. where the option file lives, so your server is the right place to do what you want, not Nativefier.

I don't see how a new Nativefier option would work, and it's so niche I think I'd rather not have the feature in. With that, closing.

Fare enough, thanks for keeping nativefier working, its a great app,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mklaber picture mklaber  路  5Comments

vegbrasil picture vegbrasil  路  4Comments

jasonivers picture jasonivers  路  4Comments

robertmylne picture robertmylne  路  5Comments

raulcraveiro picture raulcraveiro  路  4Comments