forked from jcoppieters/cody-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsconf.js
64 lines (54 loc) · 1.59 KB
/
jsconf.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* Created by johan on 25/03/15.
*/
//
// Johan Coppieters - jan 2013 - Cody CMS
//
// empty website for Cody CMS
//
//
var cody = require('cody');
var express = cody.express;
var fs = cody.fs;
var mysql = cody.mysql;
var ejs = cody.ejs;
cody.server = express();
var bodyParser = cody.bodyParser;
var expressSession = cody.expressSession;
var multer = cody.multer;
// use the new 4.x middleware
cody.server.use(bodyParser());
cody.server.use(expressSession({secret: 'a secret', cookie: { maxAge: 60*60*1000 }}));
cody.server.use(bodyParser.urlencoded({ extended: true }));
cody.server.use(multer());
// startup a routing for all static content of cody (images, javascript, css)
cody.server.get("/cody/static/*", function (req, res) {
var fileserver = new cody.Static(req, res, "");
fileserver.serve();
});
cody.startWebApp(cody.server, {
"name": "jsconf",
"mailFrom": "[email protected]",
"smtpoptions": { host: "uit.telenet.be", port: 25 },
"version": "V1.2",
"defaultlanguage": "en",
"hostnames" : "jsconf.be,www.jsconf.be,vpn.jsconf.be,jsconf.local,localhost",
"dbuser": "cody",
"dbpassword": "ydoc",
"dbhost": "localhost",
"datapath": "/usr/local/data/jsconf",
"db": "jsconf",
"controllers": require("./jsconf/controllers/")
},
function() {
console.log("Loaded Empty web app....");
var portNr = 3006;
cody.server.listen(portNr);
console.log('Listening on port ' + portNr);
}
);
if (!process.stderr.isTTY) {
process.on('uncaughtException', function (err) {
console.error('Uncaught exception : ' + err.stack);
});
}