summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js84
1 files changed, 84 insertions, 0 deletions
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..3a42816
--- /dev/null
+++ b/index.js
@@ -0,0 +1,84 @@
+var okcms = require("okcms");
+var path = require("path");
+
+var isProduction = process.env.OK_PRODUCTION === "true";
+
+var app = okcms
+ .createApp({
+ project: "No. 6092",
+
+ debug: !isProduction,
+ production: isProduction,
+
+ admin: {
+ dashboard: {
+ resources: {},
+ },
+ },
+
+ schemas: {
+ work: {
+ id: { type: "string", hidden: true },
+ title: { type: "string" },
+ author: { type: "string" },
+ description: { type: "text" },
+ thumbnail: { type: "image" },
+ image: { type: "image" },
+ hidden: { type: "flag" },
+ },
+ page: {
+ id: { type: "string", hidden: true },
+ title: { type: "string" },
+ body: { type: "text" },
+ hidden: { type: "flag" },
+ },
+ },
+
+ resources: [{ type: "work" }, { type: "page" }],
+
+ views: {
+ "/": {
+ template: "home",
+ data: [
+ { type: "work", query: "*" },
+ { type: "page", query: "*" },
+ ],
+ },
+ },
+
+ services: {
+ s3: {
+ // key: process.env.S3_KEY,
+ // secret: process.env.S3_SECRET,
+ // bucket: process.env.S3_BUCKET,
+ // dirname: "km",
+ local: {
+ localPath: path.join(__dirname, "./public/assets/uploads/"),
+ remotePath: "/assets/uploads/",
+ },
+ image: {
+ allowed: true,
+ preserveFilename: false,
+ maxbytes: 2 * 1024 * 1024,
+ },
+ file: {
+ allowed: true,
+ preserveFilename: true,
+ maxbytes: 100 * 1024 * 1024,
+ },
+ video: {
+ allowed: true,
+ preserveFilename: true,
+ maxbytes: 200 * 1024 * 1024,
+ },
+ audio: {
+ allowed: true,
+ preserveFilename: true,
+ maxbytes: 100 * 1024 * 1024,
+ },
+ },
+ },
+ })
+ .listen(process.env.PORT || 3000);
+
+console.log("Server listening at port " + (process.env.PORT || 3000) + "...");