diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 12:53:41 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 12:53:41 +0100 |
commit | a6fd2b30bf717eec14972a2175354781f5f43e77 (patch) | |
tree | 0a4fcd68e5630cf4a3274d087b4be54beac64bfa /server/helpers | |
parent | 8fd66b75bfbd8fd4945f1944411461b05eb74795 (diff) | |
download | PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.tar.gz PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.tar.zst PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.zip |
Server: move remote routes in their own directory
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/utils.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/utils.js b/server/helpers/utils.js index 9f27671b6..7e0c9823c 100644 --- a/server/helpers/utils.js +++ b/server/helpers/utils.js | |||
@@ -5,11 +5,16 @@ const crypto = require('crypto') | |||
5 | const logger = require('./logger') | 5 | const logger = require('./logger') |
6 | 6 | ||
7 | const utils = { | 7 | const utils = { |
8 | badRequest, | ||
8 | cleanForExit, | 9 | cleanForExit, |
9 | generateRandomString, | 10 | generateRandomString, |
10 | isTestInstance | 11 | isTestInstance |
11 | } | 12 | } |
12 | 13 | ||
14 | function badRequest (req, res, next) { | ||
15 | res.type('json').status(400).end() | ||
16 | } | ||
17 | |||
13 | function generateRandomString (size, callback) { | 18 | function generateRandomString (size, callback) { |
14 | crypto.pseudoRandomBytes(size, function (err, raw) { | 19 | crypto.pseudoRandomBytes(size, function (err, raw) { |
15 | if (err) return callback(err) | 20 | if (err) return callback(err) |