-
Clone this repository
git clone https://github.com/Heli-Copter/messaging-client.git
-
Install npm dependencies with
npm install
-
Run application using npm script
npm run start
-
To get production ready built code, run
npm run build
You can run this application on a virtual DNS using nginx server (for eg. messaging.gsharma.com
) by following nginx setup steps.
This is needed to run application with name in url bar.
-
Install nginx with homebrew
brew install nginx
-
Add
127.0.0.1 messaging.gsharma.com
in '/etc/hosts'
127.0.0.1 messaging.gsharma.com
-
Add directory
sites-available
andsites-enabled
. -
Add file 'messaging.gsharma.com' inside the directory 'sites-available' amd add below code:
server {
listen 443 ssl;
server_name messaging.gsharma.com;
ssl_certificate ...cert.pem; # Path to certificate
ssl_certificate_key ...key.pem; # Path to certificate key
location / {
proxy_pass https://localhost:3000;
}
}
- include created server blocks to '/usr/local/etc/nginx.conf' by adding following piece of code inside http section:
http {
include mime.types;
include sites-enabled/*.com;
...
...
}
- Create a soft link from sites-available to sites-enabled
ln -s /usr/local/etc/nginx/sites-available/messaging.gsharma.com /usr/local/etc/nginx/sites-enabled
- Reload nginx with the command
sudo nginx -s reload
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
Hi Gaurav enjoy