var okcms = require('..'); var projectSchema = { id: {type: 'string', id: true}, title: {type: 'string'}, shortname: {type: 'string'}, description: {type: 'text'}, video: {type: 'video'}, images: {type: 'captioned-image-list'} } var app = okcms.createApp({ root: 'public', schemas: { page: { id: {type: 'string'}, title: {type: 'string'}, body: {type: 'text'}, image: {type: 'string'} }, retail: projectSchema, advertising: projectSchema, experiential: projectSchema, content: projectSchema, }, resources: [ { type: 'page', static: {id: 'about'}}, { type: 'page', static: {id: 'contact'}}, { type: 'retail' }, { type: 'advertising' }, { type: 'experiential' }, { type: 'content' }, ], services: { s3: { key: process.env.S3_KEY, secret: process.env.S3_SECRET, bucket: process.env.S3_BUCKET, } }, views: { '/': { data: [ {type: 'retail', query: '*'}, {type: 'advertising', query: '*'}, {type: 'experiential', query: '*'}, {type: 'content', query: '*'}, {type: 'page', query: '*'} ] }, '/about': { data: {type: 'page', query: 'about'} }, '/contact': { data: {type: 'page', query: 'contact'} }, '/retail/:id': { data: {type: 'retail', query: ':id'}, template: 'project' }, '/advertising/:id': { data: {type: 'advertising', query: ':id'}, template: 'project' }, '/experiential/:id': { data: {type: 'experiential', query: ':id'}, template: 'project' }, '/content/:id': { data: {type: 'content', query: ':id'}, template: 'project' } } }).listen(process.env.PORT || 1337); console.log('Server listening at port ' + (process.env.PORT || 1337) + '...');