Skip to content

Instantly share code, notes, and snippets.

View hillal20's full-sized avatar

Hilal Aissani hillal20

View GitHub Profile
@hillal20
hillal20 / node_nginx_ssl.md
Created August 4, 2020 03:22 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

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. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@hillal20
hillal20 / node_nginx_ssl.md
Created August 4, 2020 03:22 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

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. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@hillal20
hillal20 / .gitignore
Created May 24, 2018 19:11 — forked from luishrd/.gitignore
Server Testing
node_modules
.DS_Store
.vscode
// /.gitignore
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
@hillal20
hillal20 / index.js
Created May 21, 2018 19:06 — forked from luishrd/index.js
Client Testing
// inside __tests__ folder
const utilities = require('../index');
describe('default', () => {
it('run the tests', () => {});
});
describe('add function', () => {
it('should add two numbers', () => {
@hillal20
hillal20 / index.js
Created May 21, 2018 19:06 — forked from luishrd/index.js
Client Testing
// inside __tests__ folder
const utilities = require('../index');
describe('default', () => {
it('run the tests', () => {});
});
describe('add function', () => {
it('should add two numbers', () => {
@hillal20
hillal20 / App.js
Created May 17, 2018 18:30 — forked from luishrd/App.js
JWT Server, all other files remain the same
// /src/App.js
import React, { Component } from 'react';
import { Route, withRouter } from 'react-router-dom';
import logo from './logo.svg';
import './App.css';
import Signin from './auth/Signin';
import Users from './users/Users';
@hillal20
hillal20 / Character.js
Created May 10, 2018 18:22 — forked from luishrd/Character.js
MongoDB Sprint
const mongoose = require('mongoose');
const ObjectId = mongoose.Schema.Types.ObjectId;
const Character = mongoose.Schema({
name: { type: String, required: true },
edited: Date,
created: Date,
gender: String,
height: String,
hair_color: String,
@hillal20
hillal20 / server.js
Last active May 3, 2018 18:52 — forked from luishrd/index.js
const express = require('express');
const helmet = require('helmet'); // 1 yarn add helment || npm i helmet // 2
// import db from './data/db';
const userRoutes = require('./users/userRoutes');
const server = express();
// client -> [error, m1, post, m3] -> [rh1, rh2]
function greeter(name) {