diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-08-14 20:36:47 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-08-14 20:36:47 +0200 |
| commit | 12c1d5bd29fcc23b5c0ddb0bf2332d256abbf3a9 (patch) | |
| tree | 32bed6c58ee53c98d5dd5e1260b44bf43b41b0ca /index.js | |
project init
Diffstat (limited to 'index.js')
| -rw-r--r-- | index.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/index.js b/index.js new file mode 100644 index 0000000..d6928e9 --- /dev/null +++ b/index.js @@ -0,0 +1,64 @@ +var okcms = require('okcms') +var path = require('path') + +var isProduction = process.env.OK_PRODUCTION === 'true' + +var app = okcms.createApp({ + + project: 'Folkestone Gossip', + + debug: !isProduction, + production: isProduction, + +// admin: { +// dashboard: { +// resources: { +// painting: { +// display: 'image', +// } +// } +// } +// }, + + schemas: { + entry: { + id: {type: 'string', hidden: true}, + title: {type: 'string'}, + date: {type: 'string'}, + tags: {type: 'text'}, + body: {type: 'text'}, + media: {type: 'media'}, + disabled: {type: 'flag'}, + }, + page: { + id: {type: 'string', hidden: true}, + title: {type: 'string'}, + body: {type: 'text'}, + disabled: {type: 'flag'}, + }, + }, + + resources: [ + { type: 'entry' }, + { type: 'page' }, + ], + + views: { + '/': { template: 'index' }, + '/entry/:id': { template: 'index' }, + }, + + 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, + }, + }, + +}).listen(process.env.PORT || 1337) + +console.log('Server listening at port ' + (process.env.PORT || 1337) + '...'); + |
