summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/index.js b/index.js
index 93b5a66..4dc697d 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,12 @@
+
+require('dotenv').config();
+
var okcms = require('okcms')
var isProduction = process.env.OK_PRODUCTION === 'true'
+var PORT = isProduction ? 6502 : 1337
+
var viewConfig = {
template: 'index',
data: [
@@ -67,10 +72,15 @@ var app = okcms.createApp({
image: { allowed: true, preserveFilename: false, maxbytes: 2*1024*1024 },
video: { allowed: true, preserveFilename: true, maxbytes: 200*1024*1024 },
audio: { allowed: true, preserveFilename: true, maxbytes: 100*1024*1024 },
+ },
+ webhook: {
+ active: isProduction,
+ secret: process.env.WEBHOOK_SECRET,
+ command: '/home/okfocus/portfolio/build.sh',
},
}
-}).listen(process.env.PORT || 1337)
+}).listen(PORT || 1337)
-console.log('Server listening at port ' + (process.env.PORT || 1337) + '...');
+console.log('Server listening at port ' + (PORT || 1337) + '...');