var okcms = require('okcms') var assign = require('object-assign') var path = require('path') var port = process.env.PORT || 1337 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'}, store: {type: 'enum', options: ["true", "false"]}, image: {type: 'captioned-image-list'}, }, page: { id: {type: 'string', hidden: true}, title: {type: 'string'}, image: {type: 'image'}, body: {type: 'text'}, tag: {type: 'string'}, }, store: { id: {type: 'string', hidden: true}, title: {type: 'string'}, collection: {type: 'string'}, CollectionId: {type: 'string'}, DepartmentId: {type: 'string'}, Departments: {type: 'link-list', textLabel: "Department Name", linkLabel: "Department ID" }, StoreStatus: {type: 'enum', options: ["open","closed"] }, DepartmentStoreStatus: {type: 'enum', options: ["open","closed"] }, GroupBy: {type: 'enum', options: ['none','size'] }, FilterBy: {type: 'enum', options: ['none','category','size'] }, ShowProductNameOnCollectionPage: {type: 'flag'}, OpensOn: {type: 'string'}, StoreClosedMessageOne: {type: 'string'}, StoreClosedMessageTwo: {type: 'string'}, NotAvailableInCanada: {type: 'flag'}, FitsLarge: {type: 'enum', options: ["use_alt_text","true","false"] }, FitsLargeText: {type: 'text' }, SizingFooter: {type: 'enum', options: ["use_alt_text","true","false"] }, SizingFooterText: {type: 'text'}, FittingCodes: {type: 'text'}, BackgroundIsGray: {type: 'enum', options: ["true","false"] }, ClosedStoreImages: {type: 'captioned-image-list'}, // modal showModal: {type: 'enum', options: ['never','once','always'] }, modalBackgroundColor: {type: 'enum', options: ["white","black",] }, modalTextColor: {type: 'enum', options: ["black","white"] }, modalTaglineColor: {type: 'enum', options: ["black","red","blue","white"] }, modalTaglinePosition: {type: 'enum', options: ["hidden","top","bottom"] }, modalTitle: {type: 'string'}, modalTagline: {type: 'string'}, modalContent: {type: 'text'}, modalButton: {type: 'string'}, }, }, resources: [ { type: 'story' }, { type: 'archive' }, { type: 'hub' }, { type: 'page' }, { type: 'store' }, ], views: { '/': {}, }, 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, }, geo: { lib: require("./lib/okgeo"), }, push: { lib: require("./lib/okpush"), // mongodbUrl: "mongodb://localhost/okpush_stone" + '_dev', // production: false, mongodbUrl: "mongodb://localhost/okpush_stone", production: true, apn_development: { cert: path.join(__dirname, "./lib/okpush/certs/aps_development_cert.pem"), key: path.join(__dirname, "./lib/okpush/certs/aps_development_key.pem"), connection: { gateway: "gateway.sandbox.push.apple.com", } }, apn_production: { cert: path.join(__dirname, "./lib/okpush/certs/aps_production_cert.pem"), key: path.join(__dirname, "./lib/okpush/certs/aps_production_key.pem"), connection: { gateway: "gateway.push.apple.com", } }, bundleId: "us.okfoc.stoneisland", notifications: { // expiry (in seconds) // badge (int) // alert (message) // payload (raw json) hub: { alert: "The hub has been updated.", }, store: { alert: "The store is now open.", }, } }, } }) app.listen(port) module.exports = app console.log('Server listening at port ' + port + '...');