Turn audio into a shareable video. forked from nypublicradio/audiogram

index.js 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. For details on these options, read SERVER.md
  3. Basic options:
  4. workingDirectory - where to keep temporary files (required)
  5. storagePath - where to keep generated audio/videos (required)
  6. fonts - a list of custom fonts (see THEMES.md for details)
  7. maxUploadSize - the maximum audio upload size, in bytes
  8. Fancy server options:
  9. s3Bucket - a bucket to store generated audio/videos. If storagePath is also set, it will store files at s3://[s3Bucket]/[storagePath]/
  10. redisHost - a redis host name/address to use for tracking jobs (e.g. "1.2.3.4" or "127.0.0.1")
  11. worker - if this is truthy, the server will add jobs to a queue. Otherwise, it will render videos on the spot itself
  12. */
  13. var path = require("path");
  14. var env = process.env.NODE_ENV || "development";
  15. module.exports = {
  16. workingDirectory: path.join(__dirname, "..", "tmp"),
  17. storagePath: (env === "development") ? path.join(__dirname, "..", "media") : "applications/audiogram/media",
  18. s3Bucket: process.env.S3_BUCKETS_NAME,
  19. fonts: [
  20. { family: "NYT Franklin", file: path.join(__dirname, "fonts", "NYTFranklinMedium.otf") },
  21. { family: "NYT Franklin Light", file: path.join(__dirname, "fonts", "NYTFranklinLight.otf") },
  22. { family: "NYT Franklin Bold", file: path.join(__dirname, "fonts", "NYTFranklinBold.otf") },
  23. { family: "NYT Karnak", file: path.join(__dirname, "fonts", "NYTKarnakText.otf") },
  24. { family: "Source Sans Pro", file: path.join(__dirname, "fonts", "SourceSansPro-Regular.ttf") },
  25. { family: "Source Sans Pro", file: path.join(__dirname, "fonts", "SourceSansPro-Light.ttf"), weight: 300 },
  26. { family: "Source Sans Pro", file: path.join(__dirname, "fonts", "SourceSansPro-Bold.ttf"), weight: "bold" },
  27. { family: "Source Sans Pro", file: path.join(__dirname, "fonts", "SourceSansPro-Italic.ttf"), style: "italic" },
  28. { family: "Source Sans Pro", file: path.join(__dirname, "fonts", "SourceSansPro-BoldItalic.ttf"), weight: "bold", style: "italic" }
  29. ],
  30. redisHost: process.env.REDIS_URI,
  31. worker: (env === "development") ? false : true
  32. };