3 // API version of our pod
4 const API_VERSION = 'v1'
6 // Score a pod has when we create it as a friend
7 let FRIEND_BASE_SCORE = 100
9 // Time to wait between requests to the friends
12 // Max length of the author username
13 const MAXIMUM_AUTHOR_LENGTH = 20
14 // 2 hours maximum for the duration of a video (in seconds)
15 let MAXIMUM_VIDEO_DURATION = 7200
17 // Number of results by default for the pagination
18 const PAGINATION_COUNT_DEFAULT = 15
20 // Number of points we add/remove from a friend after a successful/bad request
26 // Number of retries we make for the make retry requests (to friends...)
27 let REQUEST_RETRIES = 10
29 // Videos thumbnail size
30 const THUMBNAILS_SIZE = '200x110'
32 // Path for access to thumbnails with express router
33 const THUMBNAILS_STATIC_PATH = '/static/thumbnails'
35 // Special constants for a test instance
36 if (isTestInstance() === true) {
37 FRIEND_BASE_SCORE = 20
39 MAXIMUM_VIDEO_DURATION = 14
43 // ---------------------------------------------------------------------------
46 API_VERSION: API_VERSION,
47 FRIEND_BASE_SCORE: FRIEND_BASE_SCORE,
49 MAXIMUM_AUTHOR_LENGTH: MAXIMUM_AUTHOR_LENGTH,
50 MAXIMUM_VIDEO_DURATION: MAXIMUM_VIDEO_DURATION,
51 PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT,
52 PODS_SCORE: PODS_SCORE,
53 REQUEST_RETRIES: REQUEST_RETRIES,
54 THUMBNAILS_SIZE: THUMBNAILS_SIZE,
55 THUMBNAILS_STATIC_PATH: THUMBNAILS_STATIC_PATH
58 // ---------------------------------------------------------------------------
60 function isTestInstance () {
61 return (process.env.NODE_ENV === 'test')