We need to generate secret key for development environment.
mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf
Let's generate User model and controller.
/* ----------------------------------- preSignUp -------------------------------------------*/ | |
exports.handler = async (event) => { | |
// Confirm the user | |
event.response.autoConfirmUser = true; | |
// Set the email as verified if it is in the request | |
if (event.request.userAttributes.hasOwnProperty("email")) { | |
event.response.autoVerifyEmail = true; |
#!/bin/bash | |
#source DB (localhost or IP) | |
source_host=localhost | |
source_port=6379 | |
source_db=0 | |
#target DB (localhost or IP) | |
target_host=localhost2 | |
target_port=6379 | |
target_db=0 |
import { convertFromRaw, convertToRaw, ContentState } from 'draft-js'; | |
const getIndicesOf = (searchStr, str, caseSensitive) => { | |
let tempStr = str; | |
let tempSearchStr = searchStr; | |
const searchStrLen = tempSearchStr.length; | |
if (searchStrLen === 0) { | |
return []; | |
} | |
let startIndex = 0; |
## Install NGINX | |
$ sudo yum install nginx -y | |
## Install PHP and PHP-FPM | |
$ sudo yum install php -y | |
$ sudo yum install php-fpm -y | |
## Configure NGINX (see below) | |
$ sudo nano /etc/nginx/conf.d/default.conf |