Skip to content

Instantly share code, notes, and snippets.

View nrempel's full-sized avatar
🦀

Nick Rempel nrempel

🦀
View GitHub Profile
#!/bin/bash
set -e
SCRIPT_HOME="$( cd "$( dirname "$0" )" && pwd )"
cd $SCRIPT_HOME
case "$1" in
start)
docker-compose up web worker clock
const express = require('express');
const pg = require('pg');
const redis = require('redis');
const amqp = require('amqplib/callback_api');
const app = express();
app.get('/', (req, res) => {
res.send('Hello World!')
});
const amqp = require('amqplib/callback_api');
amqp.connect(process.env.RABBIT_URL, (err, conn) => {
conn.createChannel((err, ch) => {
// Consume messages from web queue
var q1 = 'web';
ch.assertQueue(q1, { durable: false });
ch.consume(q1, (msg) => {
console.info('Message received from web process:', msg.content.toString());
}, {noAck: true});

Keybase proof

I hereby claim:

  • I am nrempel on github.
  • I am nbrempel (https://keybase.io/nbrempel) on keybase.
  • I have a public key ASAftFlDSiw5r-dyaLSzRVeB4-gNEgjo5w2Rqd2P5KbHPgo

To claim this, I am signing this object: