Skip to content

Instantly share code, notes, and snippets.

@buggtb
Created May 31, 2019 13:04
Show Gist options
  • Save buggtb/20288ed7525fb712ee24f9df9d834911 to your computer and use it in GitHub Desktop.
Save buggtb/20288ed7525fb712ee24f9df9d834911 to your computer and use it in GitHub Desktop.
Run UI on Node.js proxy
In order to run it locally you'll need a basic server setup.
Install NodeJS, if you don't have it yet.
Install local dependencies:
npm install
You can simply test and run the UI on a NodeJS proxy server called server.js, that will utilize a remote backend as source.
Just run the following command in your command line and then access the UI in the browser (by default, it will run at http://localhost:8080):
node server.js [port] [backend_host] [backend_port]
or
npm start
To start the server in HTTPS mode, you will need generate a self-signed certificate, run the following commands in your shell:
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
node server.js https [port] [backend_host] [backend_port]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment