-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (38 loc) · 1.22 KB
/
index.js
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
var keystone = require("keystone");
if (keystone.get("env") == "production") {
console.log("PRODUCTION");
keystone.init({
"cookie secret": "secure string goes here",
name: "uclaradio-blog",
"user model": "User",
"auto update": true,
auth: true,
static: ["./server/public/js/", "./server/public/img/"],
mongo: process.env.MONGODB_URI,
"cloudinary config": process.env.CLOUDINARY_URL
});
} else {
console.log("DEV");
var config = require("./config.json");
keystone.init({
"cookie secret": "secure string goes here",
name: "uclaradio-blog",
"user model": "User",
"auto update": true,
auth: true,
static: ["./server/public/js/", "./server/public/img/"],
mongo: `mongodb://${config.DB_USER}:${
config.DB_PASSWORD
}@ds141924.mlab.com:41924/uclaradio-blog`,
"cloudinary config": `cloudinary://${config.CLOUD_API_KEY}:${
config.CLOUD_API_SECRET
}@${config.CLOUD_NAME}`
});
}
keystone.import("./server/models");
keystone.set("port", process.env.PORT || 3010);
keystone.set("routes", require("./server/routes"));
keystone.set('cors allow origin', true);
keystone.set('cors allow methods', true);
keystone.set('cors allow headers', true);
keystone.start();