Skip to content

Instantly share code, notes, and snippets.

View yhegazy's full-sized avatar
🇪🇬
I may be slow to respond.

yahia yhegazy

🇪🇬
I may be slow to respond.
View GitHub Profile

Setup NGINX, SSL with custom domain on an ubuntu instance

Step-1: Setup NGINX

1.1: Install NGINX

sudo apt-get install nginx

1.2: Update NGINX's configuration

@aerrity
aerrity / client.js
Last active April 9, 2024 21:33
Node, Express & MongoDB: Button click example
console.log('Client-side code running');
const button = document.getElementById('myButton');
button.addEventListener('click', function(e) {
console.log('button was clicked');
fetch('/clicked', {method: 'POST'})
.then(function(response) {
if(response.ok) {
console.log('click was recorded');