-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefaults.js
67 lines (65 loc) · 1.87 KB
/
defaults.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
'use strict';
var PICTOR_TEMP_DIR = process.env.PICTOR_TEMP_DIR || process.env.TMPDIR || '/tmp/pictor/temp';
var PICTOR_UPLOAD_DIR = process.env.PICTOR_UPLOAD_DIR || PICTOR_TEMP_DIR;
var PICTOR_GM_FONT = process.env.PICTOR_GM_FONT;
if (!PICTOR_GM_FONT) {
switch (process.platform) {
case 'darwin':
PICTOR_GM_FONT = '/Library/Fonts/Arial.ttf';
break;
case 'linux':
PICTOR_GM_FONT = '/usr/share/fonts/truetype/ttf-dejavu/dejavu-sans.ttf';
break;
case 'win32':
PICTOR_GM_FONT = '/windows/fonts/arial.ttf';
break;
}
}
module.exports = {
http: {
host: 'localhost', // override with `--host`
port: 3001, // override with `--port`
prefix: '/api/v1',
redirect: 302, //false,301,302,307
// see express-toybox/common.js#configureMiddlewares()
middlewares: {
json: {},
urlencoded: {},
multipart: {
uploadDir: PICTOR_UPLOAD_DIR,
keepExtensions: false,
maxFields: 10 * 1024 * 1024
}
},
// see express-toybox/common.js#configureRoutes()
routes: {
root: 'build/public', // build with `grunt build`
statics: {
'/bower_components': 'bower_components' // download with 'bower install'
}
}
},
// see development/staging/production.js
// data: ...
// cache: ...
// see libs/converter
converters: {
convert: {},
resize: {},
thumbnail: {},
rotate: {},
crop: {},
cropresize: {},
resizecrop: {},
optimize: {},
meta: {},
exif: {},
watermark: {
font: PICTOR_GM_FONT
},
holder: {
font: PICTOR_GM_FONT
}
},
tempDir: PICTOR_TEMP_DIR
};