var okcms = require('okcms') var isProduction = process.env.OK_PRODUCTION === 'true' var viewConfig = { template: 'index', data: [ {type: 'timeline', query: '*'}, {type: 'page', query: '*'}, {type: 'stream', query: '*'}, {type: 'drone', query: '*'}, {type: 'about', query: '*'}, ] } var photoConfig = { template: 'photo', } var app = okcms.createApp({ project: 'Hansel and Gretel', debug: !isProduction, production: isProduction, admin: { dashboard: { resources: { painting: { display: 'image', } } } }, schemas: { timeline: { id: {type: 'string', hidden: true}, date: {type: 'string'}, title: {type: 'string'}, medium: {type: 'string'}, category: {type: 'enum', options:['Surveillance','Drones','Facial Recognition']}, keywords: {type: 'text'}, description: {type: 'text'}, image: {type: 'image'}, credit: {type: 'text'}, links: {type: 'link-list'}, disabled: {type: 'flag'}, }, drone: { id: {type: 'string', hidden: true}, title: {type: 'string'}, intro: {type: 'text'}, strikes: {type: 'string'}, totalKilled: {type: 'string'}, civiliansKilled: {type: 'string'}, childrenKilled: {type: 'string'}, links: {type: 'link-list'}, }, about: { id: {type: 'string', hidden: true}, title: {type: 'string'}, show: {type: 'text'}, herzogBio: {type: 'text'}, deMeuronBio: {type: 'text'}, aiWeiWeiBio: {type: 'text'}, video: {type: 'video'}, }, page: { id: {type: 'string', hidden: true}, title: {type: 'string'}, body: {type: 'text'}, disabled: {type: 'flag'}, }, stream: { id: {type: 'string', hidden: true}, title: {type: 'string'}, streams: {type: 'link-list'}, disabled: {type: 'flag'}, }, }, resources: [ { type: 'timeline' }, { type: 'page' }, { type: 'stream' }, { type: 'drone' }, { type: 'about' }, ], views: { '/': viewConfig, '/timeline': viewConfig, '/timeline/:id': viewConfig, '/page/:id': viewConfig, '/photo/:id': photoConfig, }, services: { s3: { key: process.env.S3_KEY, secret: process.env.S3_SECRET, bucket: process.env.S3_BUCKET, dirname: process.env.S3_DIRNAME, maxbytes: 1024*1024*2, }, awmail: { lib: require("./lib/awmail"), apikey: process.env.MAILGUN_API_KEY, domain: process.env.MAILGUN_DOMAIN, secret: process.env.MAIL_SECRET, from: 'Hansel and Gretel ', subject: 'We Found Your Face', }, }, }).listen(process.env.PORT || 1337) console.log('Server listening at port ' + (process.env.PORT || 1337) + '...');