Skip to content

Instantly share code, notes, and snippets.

View farhadjaman's full-sized avatar

MD Farhad Jaman farhadjaman

  • Mirpur,Dhaka, Bangladesh
  • 23:42 (UTC -12:00)
View GitHub Profile

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@farhadjaman
farhadjaman / ubuntu-nextjs-nginx-config-file
Created October 5, 2023 05:09 — forked from oelbaga/01 - Setup Nextjs site on Ubuntu Server - Terminal commands
Setup NextJS app on Digital Ocean Ubuntu server Full Terminal Commands Step by Step
#nginx config file for Nextjs App
#place in /etc/nginx/sites-available/name_of_config_file
server {
listen 80;
server_name domainname.com;
gzip on;
gzip_proxied any;
gzip_types application/javascript application/x-javascript text/css text/javascript;
gzip_comp_level 5;
function findNestedObject(object, keyToFind, valToFind) {
let foundObj;
JSON.stringify(object, (_, nestedValue) => {
if (nestedValue && nestedValue[keyToFind] === valToFind) {
foundObj = nestedValue;
}
return nestedValue;
});
return foundObj;
}
@farhadjaman
farhadjaman / graphql-queries-mutations.md
Last active April 19, 2023 05:56 — forked from bradtraversy/graphql-queries-mutations.md
GraphQL Queries & Mutations

GraphQL Queries & Mutations

These are the GraphQL queries and mutations for the YouTube course.

Get names of all clients

{
  clients {
    name
 }
const debug = require('debug')('steve');
debug('variable value... through debug');
//console.log('variable value... through console.');
let arr = [].fill(123, 0, 10000);
let arr2 = new arr.map(item => item * 10); // needed `new` in front of Array
debug('after the loop');
@farhadjaman
farhadjaman / keybindings.json
Created November 8, 2022 02:21 — forked from LearnWebCode/keybindings.json
In VS Code on Mac; change from control + number to cmd + number to jump between open editors.
// Place your key bindings in this file to override the defaults
[
{ "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" },
{ "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" },
{ "key": "cmd+7", "command": "workbench.action.openEditorAtIndex7" },
{ "key": "cmd+8", "command": "workbench.action.openEditorAtIndex8" },