import * as express from 'express'
import {
HLS_STREAMING_PLAYLIST_DIRECTORY,
+ PEERTUBE_VERSION,
ROUTE_CACHE_LIFETIME,
STATIC_DOWNLOAD_PATHS,
STATIC_MAX_AGE,
import { root } from '../helpers/core-utils'
import { CONFIG } from '../initializers/config'
-const packageJSON = require('../../../package.json')
const staticRouter = express.Router()
staticRouter.use(cors())
const thumbnailsPhysicalPath = CONFIG.STORAGE.THUMBNAILS_DIR
staticRouter.use(
STATIC_PATHS.THUMBNAILS,
- express.static(thumbnailsPhysicalPath, { maxAge: STATIC_MAX_AGE, fallthrough: false }) // 404 if the file does not exist
+ express.static(thumbnailsPhysicalPath, { maxAge: STATIC_MAX_AGE.SERVER, fallthrough: false }) // 404 if the file does not exist
)
const avatarsPhysicalPath = CONFIG.STORAGE.AVATARS_DIR
staticRouter.use(
STATIC_PATHS.AVATARS,
- express.static(avatarsPhysicalPath, { maxAge: STATIC_MAX_AGE, fallthrough: false }) // 404 if the file does not exist
+ express.static(avatarsPhysicalPath, { maxAge: STATIC_MAX_AGE.SERVER, fallthrough: false }) // 404 if the file does not exist
)
// We don't have video previews, fetch them from the origin instance
version: '2.0',
software: {
name: 'peertube',
- version: packageJSON.version
+ version: PEERTUBE_VERSION
},
protocols: [
'activitypub'