http://www.bargehouse.co.uk/kitchen/
Bespoke sourdough loaf filled filled with smoked bacon, Cumberland sausage, slow roasted tomatoes, leeks, oyster mushrooms, spinach, topped with a free range egg and sprinkled with cheese
exports.asyncAwait = { | |
name: 'asyncAwait', | |
description: 'I am an asyncAwait action', | |
run: async function (api, data, next) { | |
let startTime = new Date().getTime() | |
let sleep = 1000 | |
let timerPromise = new Promise((resolve, reject) => { setTimeout(resolve, sleep) }) | |
try { |
http://www.bargehouse.co.uk/kitchen/
Bespoke sourdough loaf filled filled with smoked bacon, Cumberland sausage, slow roasted tomatoes, leeks, oyster mushrooms, spinach, topped with a free range egg and sprinkled with cheese
sudo: false | |
language: node_js | |
node_js: | |
- "6" | |
env: | |
- secure: "xxxxxxxxxx=" | |
after_success: | |
- | |
# tasks/main.yml | |
- name: install certbot dependencies | |
apt: name={{ item }} state=present | |
with_items: | |
- build-essential | |
- libssl-dev | |
- libffi-dev | |
- python-dev | |
- git |
# handlers/main.yml | |
- name: restart nginx | |
service: name=nginx state=restarted | |
- name: reload nginx | |
service: name=nginx state=reloaded |
module.exports = { | |
loadPriority: 1001, // to be sure connection is defined already | |
initialize: function(api, next){ | |
api.connection.prototype.responseCode = function(code){ | |
if(this.type !== 'web'){ throw new error('only for web servers'); } | |
this.rawConnection.responseHttpCode = code; | |
}; | |
api.connection.prototype.header = function(key, value){ | |
if(this.type !== 'web'){ throw new error('only for web servers'); } |
exports.randomRow = { | |
name: 'randomFirstName', | |
description: 'I will return a random first name from the users table', | |
outputExample: {}, | |
run: function(api, data, next){ | |
pg.connect(api.config.pg.url, function(error, client, done){ | |
if(error){ return next(error); } | |
var query = 'select * from usersorer by random() limit 1'; | |
client.query(query, function(error, results){ |
exports.action = { | |
name: 'apple-app-site-association', | |
description: 'I return the wacky payload apple needs', | |
run: function(api, data, next){ | |
data.connection.sendFile('apple-app-site-association/' + api.env + '.json'); | |
data.toRender = false; | |
next(); | |
} | |
}; |
var fs = require('fs'); | |
var http = require('http'); | |
var file = __dirname + '/index.html'; | |
var connections = {}; | |
var idCouner = 0 | |
var port = 8080; | |
var handleRequset = function(request, response){ | |
idCouner++ | |
var id = idCouner; |
// middleware to set up the logger for the connection | |
var middleware = { | |
name: 'in-line-logger', | |
global: true, | |
priority: 1, | |
preProcessor: function(data, next){ | |
data.log = function(s){ | |
// create a connection ID | |
if(!data.connectionId){ data.connectionId = uuid.v4(); } | |
// set up the extra data you want to log |