summaryrefslogtreecommitdiff
path: root/index.js
blob: 147dd92fdefac7a9d85970d35cdc3b9f0bbb88d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var okcms = require('okcms')
var assign = require('object-assign')

var app = okcms.createApp({

  meta: {
    project: 'Stone Island'
  },

  debug: false,

  schemas: {
    story: {
      id: {type: 'string', hidden: true},
      title: {type: 'string'},
      image: {type: 'image'},
      body: {type: 'text'},
    },
    archive: {
      id: {type: 'string', hidden: true},
      title: {type: 'string'},
      images: {type: 'triple-captioned-image-list'},
    },
    hub: {
      id: {type: 'string', hidden: true},
      date: {type: 'date'},
      title: {type: 'string'},
      subtitle: {type: 'string'},
      body: {type: 'text'},
      link: {type: 'string'},
      image: {type: 'captioned-image-list'},
    },
  },

  resources: [
    { type: 'story' },
    { type: 'archive' },
    { type: 'hub' },
  ],

  views: {
    '/': {},
  },

  services: {
    s3: {
      key: process.env.S3_KEY,
      secret: process.env.S3_SECRET,
      bucket: process.env.S3_BUCKET,
      maxbytes: 1024*1024*2,
    }
  }

}).listen(1337)

console.log('Server listening at port 1337...');