This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let transporter = nodemailer.createTransport({ | |
host: 'smtp.office365.com', | |
port: 'XXX', | |
secureConnection: true, | |
tls: { ciphers: 'SSLv3' }, | |
auth: { | |
user: '[email protected]', | |
pass: 'xxxxxxxx' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
***Simple and stripped down version of this post: https://www.coderrocketfuel.com/article/how-to-deploy-a-next-js-website-to-a-digital-ocean-server *** | |
1. Create a New Droplet On DigitalOcean | |
a) In the first section, select the Ubuntu operating system for your server | |
b) In the "Authentication" section, make sure the "Password" option is selected and enter a strong root password for your server. | |
2. Access Server Using Root | |
a) ssh root@server_ip_address (connect to server from terminal) | |
3. Add user (OPTIONAL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Certify that postgresql service is running, using sudo service postgresql start | |
Run pg_lsclusters from your terminal | |
Check what is the cluster you are running, the output should be something like: | |
Version - Cluster Port Status Owner Data directory | |
9.6 ------- main -- 5432 online postgres /var/lib/postgresql/9.6/main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Connect t | |
ssh user@ip-address | |
//Navigate to postgres config | |
cd ../../etc/postgresql/12/main | |
//Open config file and scroll to bottom | |
sudo nano pg_hba.conf | |
//Add line to the end (Don't forget '/32' subnet mask at the end of IP address) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable */ | |
import firebaseApp from "../config/firebase"; | |
import firebase from "firebase"; | |
//READ WHOLE COLLECTION | |
export async function getAllCollection(collection) { | |
try { | |
const db = firebase.firestore(firebaseApp); | |
const data = await db.collection(collection).get(); | |
const dataResult = data.docs.map((doc) => doc.data()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from "firebase/app"; | |
import "firebase/auth"; | |
import "firebase/firestore"; | |
import "firebase/app-check"; | |
const CONFIG = { | |
apiKey: process.env.NEXT_PUBLIC_FIREBASE_KEY, | |
authDomain: process.env.NEXT_PUBLIC_FIREBASE_DOMAIN, | |
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, | |
databaseURL: process.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Configure Nginx as a Reverse Proxy | |
a) cd /etc/nginx/sites-available (navigate to nginx sites folder) | |
b) sudo touch api.example.com (create a site enrty) | |
c) sudo nano api.example.com (open it in a text editor) | |
d) Add following code in it: | |
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/html; |