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
postgres -D /usr/local/var/postgres |
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
#!/bin/bash THIS WORKED | |
bash -c 'while ! </dev/tcp/db/5432; do sleep 1; done; nodal db:bootstrap && nodal s;' | |
#THIS WORKS ONLY IF NETSTST INSTALLED | |
while ! nc -w 1 -z db 5432; do sleep 0.1; done | |
#ANOTHER WAY | |
until nc -z postgres 5432; do | |
echo "$(date) - waiting for postgres..." |
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
sqs.createQueue({QueueName: 'gmail-channel-webhooks'}, function (err, data) { | |
if (err) return console.log(err); | |
var url = data.QueueUrl; // use this queue URL to operate on the queue | |
// Sending a message | |
// The following example sends a message to the queue created in the previous example. | |
var queue = new AWS.SQS({params: {QueueUrl: url}}); | |
var body = JSON.stringify({ email: '[email protected]', 'historyId': '127f90a30t' }); | |
queue.sendMessage({ MessageBody: body }, function (err, 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
var app = require('express')(); | |
var requestProxy = require('express-request-proxy'); | |
| |
app.get('/', function(req, res) { | |
res.sendFile(__dirname + '/index.html'); | |
}); | |
| |
app.post('/api/webhooks/:channel', requestProxy({ | |
url: 'http://google.mvargeson.ultrahook.com/api/webhooks/:channel' | |
})); |
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
odule.exports = { | |
entry: './client.js', | |
output: { | |
filename: 'bundle.js' | |
}, | |
devtool: 'source-map', | |
module: { | |
loaders: [ | |
{ | |
test: /.jsx?$/, |
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
{ | |
"name": "react-redux", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "webpack", | |
"start": "nodemon server.js", | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"watch": "webpack --watch" |
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
FROM node | |
RUN mkdir -p /usr/src/your-app-name | |
WORKDIR /usr/src/your-app-name | |
COPY package.json /usr/src/your-app-name/ | |
RUN npm install | |
COPY . /usr/src/your-app-name | |
EXPOSE 3000 | |
CMD [ "npm", "start" ] |
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
'use strict'; | |
const express = require('express'); | |
// Constants | |
const PORT = 8080; | |
// App | |
const app = express(); | |
app.get('/', function (req, res) { |
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
#Go to the directory that has your Dockerfile and run the following command to build the Docker image | |
$ docker build -t <your username>/node-web-app . | |
#to run image and redirect port | |
$ docker run -p 49160:8080 -d <your username>/node-web-app | |
# see running containers | |
$ docker ps | |
# Print app output |
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
#If you specified your keys in a credentials file, this command looks like this to create an instance called aws-sandbox: | |
$ docker-machine create --driver amazonec2 aws-sandbox | |
#no crednetials file | |
$ docker-machine create --driver amazonec2 --amazonec2-access-key AKI******* --amazonec2-secret-key 8T93C******* aws-sandbox | |
# specify a region...default is automaticaally set to us-east-1 | |
$ docker-machine create --driver amazonec2 --amazonec2-region us-west-1 aws-01 | |
#make sure new machine is active host |
OlderNewer