audiobookshelf/server/routers/PublicRouter.js
advplyr 31146082f0 Update:Media item share endpoints and audio player #1768
- Add endpoints for getting tracks, getting cover image and updating progress
- Implement share session cookie and caching share playback session
- Audio player UI/UX
2024-06-29 15:05:35 -05:00

19 lines
672 B
JavaScript

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))
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))
}
}
module.exports = PublicRouter