micro-app-electron-launcher
v0.9.2
Published
Launcher for micro-apps using electron
Downloads
3
Readme
micro-app-electron-launcher
This project provides a launcher for applications built with the micro-app framework (https://github.com/mhdawson/micro-app-framework) using electron (http://electron.atom.io/). This provides the following advantages over simply opening the applications in a brower:
- It eliminates the browser address bar and makes the app look like a native application
- You can configure the starting positions for the windows
- You can start all of your micro apps with a simple npm start
This is an example of the visual difference:
Of course you can access the same micro app using either the electron launch method or a brower so you can have a native look and feel on some machines and still be able to remotely access the app from other machines with only the browser installed.
Installation
You will need Node.js 4.X or higher installed on on the path.
The easiest way is to install is using:
Alternatively you can clone this repo and then run npm install.
Configuration
To configure the micro-apps started you specify them in the file called config.json.
For example this is my config :
The values you can configure for each micro-app are as follows:
- name - any name you want to assign to the entry
- hostname - hostname where the micro-app is running
- port - port on which micro-app is listening
- tls - true if the micro-app requires tls for connections, false othewise
- options - any of the electron window options. In particular x and y let you specify the starting position and sizable lets you set whether the window can be resized or not.
- auth - if the micro-app requires authentication then you must provide the password for the micro-app encrypted using the enc_config_value.js utility. (provided as part of this project). When you start the launcher you will be prompted for the password used to generate the key for the encryption.
The script lib/enc_config_value.js can be used to encrypt a configuration value as follows:
The value provided for 'value' should be the username and password required by the micro-app separated by a ':' character. For example:
Running
To run use:
You will be prompted for a password that must match the one used to encrypt any of the "auth" values in config.json
Notes
It seems the prompt module does not work on windows. I've hacked my install to prompt for the password in a different way and should check in something better soon.