This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
2. Configuration
Tristan Chin edited this page Jul 16, 2022
·
10 revisions
Some parameters for the server can be edited to customize the limits set by default.
There are 4 ways you can change these to your liking:
- Modify the default values before building the project in the config file
- Feed environment variables to the start script
PORT=5000 PASSWORD=admin123 npm start
- Use dotenv
- Create a
.env
file at the root of the project - Specify your variables (
PORT=5000
) separated by new lines. (See How to read environment variables from NodeJS)
- Create a
- If you're using Heroku, update the config vars from the "settings" tab of your app.
Environment | Type | Description | Default |
---|---|---|---|
PORT | number | Port number of the server | 3000 |
PASSWORD | string | Password that should be used in 'Authorization' header | letmein |
USE_PASSWORD | boolean | Whether or not to authenticate routes with a password | true |
MAX_FILE_UPLOAD_COUNT | number | Maximum amount of files that can be uploaded at once | 10 |
MAX_FILE_UPLOAD_SIZE | number | Maximum file size (in bytes) of the individual file uploaded (total would be MAX_FILE_UPLOAD_SIZE * MAX_FILE_UPLOAD_COUNT) | 100MB |
MAX_MERGER_FILE_COUNT | number | Maximum total files a merger can hold | 10 |
MAX_MERGER_FILE_SIZE | number | Maximum total size (in bytes) a merger can hold | 100MB |
MAX_MERGERS | number | Maximum amount of total mergers that can exist at the same time | 5 |
CLEANUP_MERGERS_DELAY | number | Time (ms) after which a merge is cleaned up. When cleaning up a merge, all files associated with it are deleted. | 45s |
CLEAN_AFTER_MERGE | boolean | Whether or not to clean up the merger immediately after sending a merged video, instead of waiting for CLEANUP_MERGERS_DELAY . |
true |
DB_ADAPTER |
fs | redis | mongo
|
Which database adapter to use for storing data.fs - Uses a JSON file system to store data.redis - Uses a Redis database to store data. (Requires Redis to be installed)mongo - Uses a MongoDB database to store data. (Requires MongoDB to be installed)Note: if you use fs with Heroku, keep in mind Heroku deletes the files periodically. However, this shouldn't be a problem, since the app does not keep data for long. |
fs |
REDIS_URL | string | The Redis URL to use when DB_ADAPTER is redis
|
redis://localhost:6379 |
MONGO_URL | string | The MongoDB URL to use when DB_ADAPTER is mongo
|
mongodb://localhost:27017 |
REQUEST_LOGGING | boolean | Enable request logging | true |
MERGER_LOGGING | boolean | Enable merger logging | true |
DB_LOGGING | boolean | Enable database operations logging | true |
CLUSTER_MODE | boolean | Enables PM2 cluster mode, which starts multiple instances with load balancing. Note: Custer mode will not be enabled if DB_ADAPTER is set to fs . |
true |