This file contains 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
// Port, host and auth token of Redis server might be defined as environment | |
// variables. If not, fall back to defaults. | |
let redisPort = process.env.REDIS_PORT || 6379, | |
redisHost = process.env.REDIS_HOST || '127.0.0.1', | |
redisAuth = process.env.REDIS_AUTH || null, | |
redis = require('redis'); | |
// Since we are waiting for the error event, we don't have to check for errors | |
// individually after each Redis command. | |
let onError = (error) => { |
This file contains 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
/* Small devices (landscape phones, 576px and up) */ | |
@media screen and (min-width: 576px) { | |
} | |
/* Medium devices (tablets, 768px and up) */ | |
@media screen and (min-width: 768px) { | |
} | |
/* Large devices (desktops, 992px and up) */ | |
@media screen and (min-width: 992px) { |
This file contains 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
There are two ways to connect remote redis server using redis-cli: | |
1. Using host & port individually as options in command | |
redis-cli -h host -p port | |
If your instance is password protected | |
redis-cli -h host -p port -a password | |
e.g. if my-web.cache.amazonaws.com is the host url and 6379 is the port | |
Then this will be the command: |
This file contains 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
// Nodemailer is a module for Node. js applications to allow easy as cake email sending. | |
// I am assuming you have stored your SMTP details in the .env file. | |
// For development purpose I haved used mailtrap.io for sending email. | |
// Basically mailtrap creates a virtual inbox where all the mails received without spamming real customers or flooding your own and team members inboxes. | |
// Importing nodemailer | |
const nodemailer = require('nodemailer'); | |
// Here is a small function that sends email using SMTP service. | |
const sendEmail = async options => { |
This file contains 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
To generate HTML from our comments, we need to use jsdoc npm package | |
We can install it using | |
$ npm i jsdoc | |
We'll also need to install better-docs plugin for jsdocs. | |
$ npm i better-docs | |
Then we need to create a config file |
This file contains 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
To generate HTML from our comments, we need to use jsdoc npm package | |
We can install it using | |
$ npm i jsdoc | |
We'll also need to install better-docs plugin for jsdocs. | |
$ npm i better-docs | |
Then we need to create a config file |