From c98560cca095ef27b909ac47baf843362bffb28d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 14 Apr 2016 20:32:08 -0400 Subject: OKWebhook module for receiving pushes from git --- examples/index.js | 11 ++++++++++- examples/lib/okexample/index.js | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/index.js b/examples/index.js index 3bbed28..efbfc38 100644 --- a/examples/index.js +++ b/examples/index.js @@ -1,10 +1,13 @@ var okcms = require('..'); +var isProduction = process.env.OK_PRODUCTION === 'true' + var app = okcms.createApp({ root: 'public', - debug: true, + debug: !isProduction, + production: isProduction, schemas: { page: { @@ -47,6 +50,12 @@ var app = okcms.createApp({ audio: { allowed: true, preserveFilename: true, maxbytes: 100*1024*1024 }, }, + webhook: { + active: false, + secret: 'test', + command: '/path/to/build.sh', + }, + example: { lib: require("./lib/okexample"), stuff: "things", diff --git a/examples/lib/okexample/index.js b/examples/lib/okexample/index.js index b614697..04c5984 100644 --- a/examples/lib/okexample/index.js +++ b/examples/lib/okexample/index.js @@ -22,13 +22,14 @@ function OKExample (options) { if (!(this instanceof OKExample)) return new OKExample(options) options = options || {} if (!options.express) - throw new Error('Express not provided to OKDumpfm'); + throw new Error('Express not provided to OKExample'); if (!options.config) - throw new Error('Configuration not provided to OKDumpfm'); + throw new Error('Configuration not provided to OKExample'); var express = options.express var router = express.Router() var config = options.config + var db = options.db router.get('*', function (req, res) { res.send(config.stuff) -- cgit v1.2.3-70-g09d2