This repository has been archived by the owner on Jun 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
properties.js
64 lines (59 loc) · 1.69 KB
/
properties.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
var _ = require('lodash')
, basePort = 3020
, join = require('path').join
var properties =
{ version: '0.1.0'
, name: 'ctrl'
, tagline: 'More JavaScripty than your traditional CMS'
, description: 'A node.js CMS for quickly building powerful web sites, tailored to your exact needs'
, keywords: 'ctrl'
, pageTitle: 'ctrl CMS'
, port: basePort + 1
, email: '[email protected]'
, siteUrl: 'http://localhost:' + (basePort + 1)
, logPath: join(__dirname, '/logs')
, cachePath: join(__dirname, '/cache')
, dataPath: join(__dirname, '/data')
, binaryCachePath: '/binary/'
, database:
{ host: '127.0.0.1'
, port: 27017
, name: 'ctrl-development'
}
, bcryptWorkFactor: 1
, debug: true
, changeEmailSender: '[email protected]'
}
var environmentProperties = {
development: {}
, testing: {
siteUrl: 'http://localhost:' + (basePort + 2)
, database:
{ replSet:
{ name: 'ctrl'
, servers: [
{ host: 'localhost', port: 28000 }
, { host: 'localhost', port: 28001 }
]
}
, name: 'ctrl-testing'
}
}
, production: {
siteUrl: 'http://localhost:' + (basePort + 3)
, port: basePort + 3
, email: '[email protected]'
, database:
{ host: '127.0.0.1'
, port: 27017
, name: 'ctrl-production'
}
}
}
module.exports = function getProperties (environment) {
properties.env = environment = environment || process.env.NODE_ENV || 'development'
if (environmentProperties[environment] === undefined) {
throw new RangeError('No properties for environment \'' + environment + '\'')
}
return _.extend({}, properties, environmentProperties[environment])
}