forked from newsdev/audiogram
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
87 lines (80 loc) · 2.51 KB
/
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
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
/*
For details on these options, read SERVER.md
Basic options:
workingDirectory - where to keep temporary files (required)
storagePath - where to keep generated audio/videos (required)
fonts - a list of custom fonts (see THEMES.md for details)
maxUploadSize - the maximum audio upload size, in bytes
Fancy server options:
s3Bucket - a bucket to store generated audio/videos. If storagePath is also set, it will store files at s3://[s3Bucket]/[storagePath]/
redisHost - a redis host name/address to use for tracking jobs (e.g. "1.2.3.4" or "127.0.0.1")
worker - if this is truthy, the server will add jobs to a queue. Otherwise, it will render videos on the spot itself
*/
var path = require("path");
var env = process.env.NODE_ENV || "development";
module.exports = {
workingDirectory: path.join(__dirname, "..", "tmp"),
storagePath:
env === "development"
? path.join(__dirname, "..", "media")
: "applications/audiogram/media",
s3Bucket: process.env.S3_BUCKETS_NAME,
fonts: [
{
family: "NYT Franklin",
file: path.join(__dirname, "fonts", "NYTFranklinMedium.otf"),
},
{
family: "NYT Franklin Light",
file: path.join(__dirname, "fonts", "NYTFranklinLight.otf"),
},
{
family: "NYT Franklin Bold",
file: path.join(__dirname, "fonts", "NYTFranklinBold.otf"),
},
{
family: "NYT Karnak",
file: path.join(__dirname, "fonts", "NYTKarnakText.otf"),
},
{
family: "Source Sans Pro",
file: path.join(__dirname, "fonts", "SourceSansPro-Regular.ttf"),
},
{
family: "Source Sans Pro",
file: path.join(__dirname, "fonts", "SourceSansPro-Light.ttf"),
weight: 300,
},
{
family: "Source Sans Pro",
file: path.join(__dirname, "fonts", "SourceSansPro-Bold.ttf"),
weight: "bold",
},
{
family: "Source Sans Pro",
file: path.join(__dirname, "fonts", "SourceSansPro-Italic.ttf"),
style: "italic",
},
{
family: "Ubuntu",
file: path.join(__dirname, "fonts", "Ubuntu-Regular.ttf"),
},
{
family: "Ubuntu",
file: path.join(__dirname, "fonts", "Ubuntu-Light.ttf"),
weight: "light",
},
{
family: "Ubuntu",
file: path.join(__dirname, "fonts", "Ubuntu-Medium.ttf"),
weight: "medium",
},
{
family: "Ubuntu",
file: path.join(__dirname, "fonts", "Ubuntu-Bold.ttf"),
weight: "bold",
},
],
redisHost: process.env.REDIS_URI,
worker: env === "development" ? false : true,
};