diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-09-02 13:24:55 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-09-02 13:24:55 -0400 |
| commit | 8def9579f2a78e80652d1e5e6f1eda510ae9a5dd (patch) | |
| tree | c56d664f04d55f0d75c6d4f5e2d6fc567054498d /examples/index.js | |
| parent | 4ed81fa59119cee66b0413c5662639ec81fea4dc (diff) | |
| parent | 5052d51aa4c55eabc736b3c76a783db2f5208289 (diff) | |
merge changes from twohustlers
Diffstat (limited to 'examples/index.js')
| -rw-r--r-- | examples/index.js | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/examples/index.js b/examples/index.js index 0b9bf02..f1fabfa 100644 --- a/examples/index.js +++ b/examples/index.js @@ -1,14 +1,32 @@ var okcms = require('..'); +var isProduction = process.env.OK_PRODUCTION === 'true' +var port = process.env.PORT || 1337; + var app = okcms.createApp({ root: 'public', + debug: !isProduction, + production: isProduction, + + admin: { + dashboard: { + resources: { + card: { + groupBy: 'stack', + descending: true + } + } + }, + }, + schemas: { page: { id: {type: 'string'}, title: {type: 'string'}, - body: {type: 'text'} + body: {type: 'text'}, + links: {type: 'link-list'}, }, bread: { type: {type: 'string', id: true}, @@ -16,7 +34,27 @@ var app = okcms.createApp({ description: {type: 'text'}, color: {type: 'enum', options: ["red","blue","green"]}, video: {type: 'video'}, - images: {type: 'captioned-image-list'} + images: {type: 'gallery'} + }, + test: { + id: {type: 'string', hidden: true}, + title: {type: 'string'}, + flagged: {type: 'flag'}, + media: {type: 'media'}, + }, + flour: { + id: {type: 'string', hidden: true}, + title: {type: 'string'}, + image: {type: 'image'}, + }, + card: { + id: {type: 'string', hidden: true}, + title: {type: 'string'}, + stack: {type: 'foreign-key', key: 'stack'}, + }, + stack: { + id: {type: 'string', hidden: true}, + title: {type: 'string'}, } }, @@ -24,6 +62,10 @@ var app = okcms.createApp({ { type: 'page', static: {id: 'about'}}, { type: 'page', static: {id: 'contact'}}, { type: 'bread' }, + { type: 'test' }, + { type: 'flour' }, + { type: 'card' }, + { type: 'stack' }, ], services: { @@ -31,6 +73,25 @@ var app = okcms.createApp({ key: process.env.S3_KEY, secret: process.env.S3_SECRET, bucket: process.env.S3_BUCKET, + dirname: "okcms-example", + 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: false, + secret: 'test', + command: '/path/to/build.sh', + }, + + example: { + lib: require("./lib/okexample"), + stuff: "things", + }, + + dumpfm: { + lib: require("./lib/okdumpfm"), } }, @@ -52,6 +113,6 @@ var app = okcms.createApp({ } } -}).listen(process.env.PORT || 1337); +}).listen(port) -console.log('Server listening at port ' + (process.env.PORT || 1337) + '...'); +console.log('Server listening at port %d...', port); |
