forked from jsperf/jsperf.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.js
110 lines (104 loc) · 2.7 KB
/
manifest.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
var Confidence = require('confidence');
var _ = require('lodash');
var config = require('./config');
var criteria = {
env: process.env.NODE_ENV
};
var visionaryContextDefault = {
cssFile: 'main.css',
headTitle: 'jsPerf: JavaScript performance playground',
scheme: config.get('/scheme'),
domain: config.get('/domain')
};
var manifest = {
$meta: 'jsPerf backend',
server: {
connections: {
routes: {
security: true
}
}
},
connections: [{
port: config.get('/port/web'),
labels: ['web']
}],
plugins: [
{'blipp': {}},
{'good': {
reporters: [{
reporter: 'good-console',
args: [{
log: '*',
response: '*'
}]
}]
}},
{'visionary': {
engines: {
hbs: 'handlebars'
},
relativeTo: __dirname,
path: './server/web',
layout: true,
helpersPath: 'templates/helpers',
partialsPath: 'templates/partials',
context: {
$filter: 'env',
development: _.assign(visionaryContextDefault, {
debug: true,
cssFile: 'main.src.css?' + Date.now(),
headTitle: 'jsPerf-dev'
}),
$default: visionaryContextDefault
}
}},
{'yar': {
cookieOptions: {
// name: 'jsPerf', FIXME
password: config.get('/browserscope'),
isSecure: !config.get('/debug'),
isHttpOnly: true
}
}},
{'bell': {}},
{'hapi-auth-cookie': {}},
{'./server/web/auth/strategies': {
session: {
password: config.get('/auth/session/pass'),
cookie: config.get('/auth/session/name'),
isSecure: config.get('/auth/session/secure')
},
oauth: {
password: config.get('/auth/oauth/cookiePass'),
clientId: config.get('/auth/oauth/github/id'),
clientSecret: config.get('/auth/oauth/github/secret'),
isSecure: config.get('/auth/oauth/secure'),
location: config.get('/scheme') + '://' + config.get('/domain')
}
}},
{'./server/api/json': {}},
{'./server/api/jsonp': {}},
{'./server/web/auth/github': {}},
{'./server/web/browse': {}},
{'./server/web/contributors': {}},
{'./server/web/errors': {}},
{'./server/web/faq': {}},
{'./server/web/health': {}},
{'./server/web/home': {}},
{'./server/web/popular': {}},
{'./server/web/public': {}},
{'./server/web/redirects': {}},
{'./server/web/search': {}},
{'./server/web/sitemap/xml': {}},
{'./server/web/test': {}},
{'./server/web/edit': {}}
]
};
var store = new Confidence.Store(manifest);
exports.get = function (key) {
return store.get(key, criteria);
};
exports.meta = function (key) {
return store.meta(key, criteria);
};