# Terminal Cheat Sheet | |
pwd # print working directory | |
ls # list files in directory | |
cd # change directory | |
~ # home directory | |
.. # up one directory | |
- # previous working directory | |
help # get help | |
-h # get help |
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
#!/bin/bash | |
# date: 20-11-03 | |
# dev: codingChewie | |
# purpose: Unzip an ePub with name passed in Terminal | |
# version: 1.1 | |
# name: unzip-pub.sh | |
EXT=".epub" | |
LOC="" |
# !/bin/bash | |
## date: 20-11-05 | |
## dev: codingChewie | |
## purpose: validates CSS files | |
## version: 1.0 | |
## name: cssvalidate.sh | |
CSS_DIR="" ## Directory where CSS files will be placed to be tested | |
CSS_JAR="" ## Location for JAR files |
const express = require("express") | |
const app = express() | |
var passport = require("passport") | |
var session = require("express-session") | |
var GitHubStrategy = require("passport-github2").Strategy | |
const GITHUB_CLIENT_ID = "your-client-id-here" // or get from process.env.GITHUB_CLIENT_ID | |
const GITHUB_CLIENT_SECRET = "your-client-secret-here" // or get from process.env.GITHUB_CLIENT_SECRET | |
const GITHUB_CALLBACK_URL = "http://localhost:5000/auth/github/callback" // or get from process.env.GITHUB_CALLBACK_URL |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
After reading the Q&A I didn't see my issues resolved with the provided source files of the shopsy app so hope this helps the next person resolve the package.json issues I'm experiencing.
The video instructed to run an npm i
but I received a few fatal errors and this is because of the "bcrypt": "^1.0.3"
being deprecated. I did find a Q&A that mentions bcrypt-nodejs
but when I reference this on NPM it indicates it's deprecated. Instead I removed the line "bcrypt": "^1.0.3"
and replaced it with npm i bcryptjs
.
When I ran npm start
I received an error of bcrypt and that is because there is a require in a file that needs to be changed:
/server/models/mongoose/User.js
// the main app file | |
import express from "express"; | |
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
import authenticate from "./authentication"; // middleware for doing authentication | |
import permit from "./permission"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
You can run your Express app very easily inside your Electron app.
All you need to do is to:
- place all the files of your Express app inside a new app folder in
your_electron_app\resources\app
- reconfigure the
app.js
file - refactor some relative pathes in your Express app