https://sandstorm.github.io/typescript-react-app-kickstart-guide/guide/kickstart/storybook
const obj = { | |
...condition && { prop: value }, | |
}; | |
// via From https://dev.to/jfet97/the-shortest-way-to-conditional-insert-properties-into-an-object-literal-4ag7 |
{ | |
"apps" : [{ | |
"name" : "prerender.io", | |
"script" : "./server.js", | |
"watch" : false, | |
"node_args" : "--max_old_space_size=12288", | |
"NODE_ENV" :"prod", | |
"env": { | |
"PORT": 12345 | |
}, |
tuts and config examples:
https://blog.karmacomputing.co.uk/how-to-create-mongodb-replica-set-with-authentication-ubuntu-16-04/ https://www.digitalocean.com/community/tutorials/how-to-implement-replication-sets-in-mongodb-on-an-ubuntu-vps http://blog.brunobonacci.com/2013/02/22/how-to-convert-a-standalone-mongodb-into-a-replica-set/ https://docs.pritunl.com/docs/securing-mongodb https://medium.com/@rossbulat/deploy-a-3-node-mongodb-3-6-replica-set-with-x-509-authentication-self-signed-certificates-d539fda94db4 https://medium.com/ninjaconcept/how-to-quickly-setup-mongodb-on-digitalocean-3d9791a7aaa4 https://gist.github.com/davisford/bb37079900888c44d2bbcb2c52a5d6e8
In a mongo shell, run rs.status() to ensure your replica set is running as expected.
In a mongo shell connected to the mongod instance running on mdb2.example.net, freeze mdb2.example.net so that it does not attempt to become primary for 120 seconds.
rs.freeze(120)
In a mongo shell connected the mongod running on mdb0.example.net, step down this instance that the mongod is not eligible to become primary for 120 seconds:
rs.stepDown(120)
- during new droplet creating or
- from dashboard in Networking menu
https://www.digitalocean.com/docs/networking/private-networking/how-to/enable/#ubuntu-16-04
ping 1.2.3.4
made a backup first though JIC,
sudo cp /etc/letsencrypt/ /etc/letsencrypt.backup -r
Delete the ‘no longer needed domains’ in the three folders…
rm -rf /etc/letsencrypt/live/${DOMAIN}
rm -rf /etc/letsencrypt/renewal/${DOMAIN}.conf
rm -rf /etc/letsencrypt/archive/${DOMAIN}
1. configure nginx config (or virtual host config) which is serving your local react (or any js framework) app via this official prerender.io nginx config:
https://gist.github.com/thoop/8165802
https://prerender.io/documentation/test-it
Note: if the server won't run because of missing chrome installed, then install it. On ubuntu follow this instructions:
https://www.ubuntuupdates.org/ppa/google_chrome?dist=stable -> the final command is sudo apt-get install google-chrome-stable
import { createLogger, format, transports } from 'winston'; | |
import { LOGGER_LEVEL, LOGGER_LEVELS, DEVELOPMENT_MODE } from './config'; | |
const formatTemplate = (message, ...data) => `(${message}) ${data}`; | |
export default class Logger { | |
constructor() { | |
this.logger = createLogger({ | |
format: format.simple(), | |
level: LOGGER_LEVEL, |