Author

Apache ProxyPass websocket (wss) problem

<VirtualHost *:443> ServerName mysite.com ServerAlias www.mysite.com SSLEngine on SSLProxyEngine On ProxyRequests Off SSLCertificateFile /etc/apache2/ssl/mysite.com.crt SSLCertificateKeyFile /etc/apache2/ssl/mysite.com.key SSLCertificateChainFile /etc/apache2/ssl/ca.cer DocumentRoot /var/www/errorPages ErrorDocument 503 /503.html ProxyPass /503.html ! ProxyPass / http://localhost:3999/ ProxyPassReverse / http://localhost:3999/ RewriteEngine on RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC] RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC] RewriteRule .* ws://localhost:3999%{REQUEST_URI} [P] </VirtualHost>

How to host React App using Express

Create a package.json file containing following contents. { "name": "app_name", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "express": "^4.16.3", "path": "^0.12.7", "react-color": "^2.18.1" } } npm install Now Create app.js file containing following contents. const express = require('express');... » read more

Mongoose find to match id with values stored as comma separated string
Mongoose find to match id with values stored as comma separated string

Mongoose query (find) to match id with values stored as comma separated string in MongoDB Assuming that we have stored the values into db is like [ { "tags": "fun,game,reading,photography" }, { "tags": "politics,game,workout,photography" }, { "tags": "programming,photography,business" } ] Model: Customer Customer.find({$where : 'this.categoryid.indexOf("' + categoryId + '") != -1'}); Originally posted Here

How to use React JS and Node JS App without Port
How to use React JS and Node JS App without Port

Use Apache as a proxy server using ProxyPass and ProxyPassReverse to access internal IPs from an external machine As we know every node js application is running on particular port. and we think about to host on production server, we have to run on port there. As simplicity we don’t want to disturb the internal... » read more

Git cheatsheet for beginners
Git cheatsheet for beginners

Git cheatsheet for beginners Now days git is a very useful and powerful skill to have and almost necessary in many development companies. getting job offers for software developers, you may realize that knowing git is nearly as important as knowing an actual normal programming language. But still many people forget to check out how... » read more