2024-06-22 23:42:13 +02:00
|
|
|
const express = require('express')
|
|
|
|
const ShareController = require('../controllers/ShareController')
|
|
|
|
|
|
|
|
class PublicRouter {
|
|
|
|
constructor() {
|
|
|
|
this.router = express()
|
|
|
|
this.router.disable('x-powered-by')
|
|
|
|
this.init()
|
|
|
|
}
|
|
|
|
|
|
|
|
init() {
|
|
|
|
this.router.get('/share/:slug', ShareController.getMediaItemShareBySlug.bind(this))
|
2024-06-29 22:05:35 +02:00
|
|
|
this.router.get('/share/:slug/track/:index', ShareController.getMediaItemShareAudioTrack.bind(this))
|
|
|
|
this.router.get('/share/:slug/cover', ShareController.getMediaItemShareCoverImage.bind(this))
|
|
|
|
this.router.patch('/share/:slug/progress', ShareController.updateMediaItemShareProgress.bind(this))
|
2024-06-22 23:42:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = PublicRouter
|