-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
31 lines (25 loc) · 876 Bytes
/
app.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
var config = require('./config'),
express = require('express'),
Zotero = require('./lib/zotero'),
cons = require('consolidate'),
server = express();
// Set template engine
server.engine('html', cons.swig);
server.set('view engine', 'html');
server.set('views', __dirname + '/views');
// Static files
server.use(express.static(__dirname + '/public'));
// Set public bower components
server.use('/components', express.static(__dirname + '/bower_components'));
// Creating a new instance of Zotero
var zotero = new Zotero({
user: config.zotero.user,
key: config.zotero.key,
collection: config.zotero.collection
});
// Controllers
require('./controllers/welcome')(server);
require('./controllers/items')(server, zotero);
server.listen(process.env.PORT || 3000, function () {
console.log('Server listening at %s', process.env.PORT || 3000);
});