- Git (2.6.1 or higher)
- NodeJS (6.2.2 or higher)
- yarn (0.21.2 or higher)
- Visual Studio (2013 only)
Windows only
- MailDev
Local Mail Server for Testing Email
Default configs are configSettings.js
. Here's an example of what defaults might look like
env: 'production', // Can be 'development' or 'production'.
//- Server
protocol: 'http', // Using `https` requires valid certificates.
hostname: '0.0.0.0', // Can be 0.0.0.0 for binding to all ports.
port: 3000, // Port of webserver.
// proxyPort: 3001, // Optional. Will be `port + 1` if not defined.
//- Testing
testsPath: '/tests', // Path used when performing unit-tests
//- Email Submission
mailSendPath: '/contact/send', // Path that's used when doing a POST to send mail.
mailOptions: { // Options for Nodemailer.
from: 'Fake User <[email protected]>', // When sending mail, this appears in the `FROM` field
},
smtpCredentials: { // Configuration for a local maildev server.
host: 'localhost',
port: 1025,
tls: {
rejectUnauthorized: false,
}
}
To override these configs, either setup Node env vars such as: NODE_ENV
, PROTOCOL
, HOSTNAME
, PORT
, etc or create a ./server/configs/config.js
file and have it return an object with overrides like so:
module.exports = {
env: 'development',
protocol: 'https',
port: 443,
}
Example using maildev (npm i -g maildev
):
smtpCredentials: {
host: 'localhost',
port: 1025,
tls: { rejectUnauthorized: false },
}
Example gmail.com string:
smtpCredentials: 'smtps://user%40gmail.com:[email protected]'
Start the local catch-all SMTP server using the command maildev
.
yarn start
OR
bash local.sh
OR
node index.js
Start a single server for testing:
bash server.sh
Start a cluster of 3
servers for load balancing in production:
bash server.sh 3
The number 3
can be replaced with any number. The default is 0
: equal to the number of CPU cores.
bash update.sh
If you update the update.sh file, make sure to run git pull
prior to running the update script.
bash stopServer.sh
Make sure to run this command to upgrade pip before starting:
pip install --upgrade pip
Optionally, you can upgrade Let's Encrypt:
cd /usr/share/letsencrypt/
git pull
Replace SERVER_NAME
with the website address.
service nginx stop
/usr/share/letsencrypt/letsencrypt-auto certonly \
-a standalone \
-d www.SERVER_NAME \
-d SERVER_NAME \
--server https://acme-v01.api.letsencrypt.org/directory
service nginx start
Or try this experimental approach:
/usr/share/letsencrypt/letsencrypt-auto certonly \
-a nginx \
-d www.SERVER_NAME \
-d SERVER_NAME \
--server https://acme-v01.api.letsencrypt.org/directory
When running the Let's Encrypt with, it requires installing the NGINX plugin:
cd /usr/share/letsencrypt/
~/.local/share/letsencrypt/bin/pip install -U letsencrypt-nginx
Let's Encrypt allows renewing using:
/usr/share/letsencrypt/letsencrypt-auto renew
For ServiceWorker compatibility, update or use these certs along with
https
innetwork-protocol
.
Using ZeroSSL and their FREE SSL Certificate Wizard:
- Files are located in
conf/
Install packages globally for Sublime Text's SublimeLinter-contrib-eslint
plugin.
npm i -g babel-eslint eslint-plugin-react