From 12c1d5bd29fcc23b5c0ddb0bf2332d256abbf3a9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 14 Aug 2017 20:36:47 +0200 Subject: project init --- .gitignore | 12 ++++++++++++ README.md | 7 +++++++ index.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 11 +++++++++++ 4 files changed, 94 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4dd7bd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +.env +node_modules/ +!public/db.json +.DS_Store +*.swp +app.css +app.min.js +.tmp +bower_components/ +npm-debug.log +*.zip + diff --git a/README.md b/README.md new file mode 100644 index 0000000..7f71f8c --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +folkestone +========== + +``` +npm install +node index +``` 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) + '...'); + diff --git a/package.json b/package.json new file mode 100644 index 0000000..0145e8f --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "folkestone", + "version": "1.0.0", + "description": "the folkestone gossip", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +} -- cgit v1.2.3-70-g09d2