-
Notifications
You must be signed in to change notification settings - Fork 47
/
index.js
44 lines (31 loc) · 966 Bytes
/
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
42
43
44
'use strict';
var kraken = require('kraken-js'),
db = require('./lib/database'),
language = require('./lib/language'),
express = require('express'),
paypal = require('paypal-rest-sdk'),
app = {};
app.configure = function configure(nconf, next) {
// Fired when an app configures itself
//Configure the database
db.config(nconf.get('databaseConfig'));
//Configure the PayPal SDK
paypal.configure(nconf.get('paypalConfig'));
next(null);
};
app.requestStart = function requestStart(server) {
// Fired at the beginning of an incoming request
};
app.requestBeforeRoute = function requestBeforeRoute(server) {
// Fired before routing occurs
server.use(express.methodOverride());
server.use(language());
};
app.requestAfterRoute = function requestAfterRoute(server) {
// Fired after routing occurs
};
kraken.create(app).listen(function (err) {
if (err) {
console.error(err);
}
});