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/*global __dirname,process*/
var fs = require('fs'),
_ = require('underscore'),
defaults,
creds;
//all configurations
defaults = {
s3: {
key: process.env.S3_KEY,
secret: process.env.S3_SECRET,
bucket: 'toxiclibsjs',
access: 'public-read'
},
doccoPath: 'generated/docs/',
stylesheetsPath: 'generated/stylesheets/',
baseUrl: 'src/',
toxiclibsjsBuildUrl: '/toxiclibsjs/build/toxiclibs.js',
toxiclibsjsDir: 'node_modules/toxiclibsjs/',
layout: 'src/views/layout.jade',
examples: 'src/javascripts/examples/',
githubExamples: 'https://github.com/hapticdata/toxiclibsjs-examples/blob/master/src/javascripts/examples/',
//the root location of the site
rootUrl: '/',
//the hard-disk location of static files to serve during development
staticDir: 'src/',
//pretty-type the html
pretty: true,
//port to run server on
port: 3004
};
creds = {
dev: {
//the root location for the static assets over http
staticUrl: '/',
toxiclibsjsBuildUrl: 'http://s3.amazonaws.com/toxiclibsjs/toxiclibsjs/build/toxiclibs.min.js',
},
staging: {
staticUrl: '/',
staticDir: 'dist/'
},
production: {
//in production load all static assets off s3,
staticUrl: 'http://s3.amazonaws.com/toxiclibsjs/',
//also load the minified toxiclibs
toxiclibsjsBuildUrl: 'http://s3.amazonaws.com/toxiclibsjs/toxiclibsjs/build/toxiclibs.min.js',
//the site is hosted in this sub-directory of haptic-data.com
rootUrl: '/toxiclibsjs/',
compress: true
}
};
/**
* Various credentials and other protected information
*/
exports = module.exports = function( env, config ){
env = env || process.env.NODE_ENV;
if (env !== 'staging' && env !== 'production') {
env = 'dev';
}
return _.defaults( _.defaults(creds[env], config || {}), defaults );
};