dimanche 5 février 2017

Confusing between webapp using NodeJs server and electron

I am learning how to develop a desktop app with Electron. I developed websites long time ago in php with session variables and many include.

I want a navbar with some pages. When we click on a link in the navbar, only the page below will change, I want to avoid the white flash.

I read a lot but I am still confused since there is no server in Electron to check everything.

For example how to make a login webpage with a simple password ?!

In PHP I would send the form to a PHP page using POST that will process the password server-side and then display or not the content and create a flag session variable in order to allow or not other pages.

But since everybody could see the javascript code and then the fixed in-code password, it is still confusing.

Possible solution: Using Ember or AngularJs for the routing only but I still didn't find the way to include a page which the content will be conditionally displayed. In PHP just insert the html in if statement.

My project: I have a socket server which send me in real-time data, I want to connect to the server and display the data only if the user is allowed. The server and the data are depending on the page.

  • Should I consider the main process as a NodeJs server and the render process the client side ?

Please if my question doesn't follow the rules, just tell me in comment, I'll delete it.




Aucun commentaire:

Enregistrer un commentaire