reintroduced constants.js

This commit is contained in:
Sami Salkosuo 2020-04-16 12:16:03 +03:00
parent ea68bafdb3
commit 9012927cd8
2 changed files with 6 additions and 3 deletions

View File

@ -7,9 +7,10 @@ const ffmpeg = require('fluent-ffmpeg');
const uniqueFilename = require('unique-filename');
const endpoints = require('./endpoints.js');
const logger = require('./logger.js')
const logger = require('./logger.js');
const constants = require('./constants.js');
fileSizeLimit = parseInt(process.env.FILE_SIZE_LIMIT_BYTES || "536870912") //536870912 = 512MB
fileSizeLimit = constants.fileSizeLimit;
port = 3000;
timeout = 3600000;
@ -140,5 +141,5 @@ server.on('connection', function(socket) {
});
app.use(function(req, res, next) {
res.status(404).send(JSON.stringify({error: 'route not available'})+'\n');
res.status(404).send(JSON.stringify({error: 'route not found'})+'\n');
});

2
src/constants.js Normal file
View File

@ -0,0 +1,2 @@
exports.fileSizeLimit = parseInt(process.env.FILE_SIZE_LIMIT_BYTES || "536870912") //536870912 = 512MB