1 import cors from 'cors'
2 import express from 'express'
3 import { mapToJSON } from '@server/helpers/core-utils'
4 import { LiveSegmentShaStore } from '@server/lib/live'
5 import { HttpStatusCode } from '@shared/models'
7 const liveRouter = express.Router()
9 liveRouter.use('/segments-sha256/:videoUUID',
14 // ---------------------------------------------------------------------------
20 // ---------------------------------------------------------------------------
22 function getSegmentsSha256 (req: express.Request, res: express.Response) {
23 const videoUUID = req.params.videoUUID
25 const result = LiveSegmentShaStore.Instance.getSegmentsSha256(videoUUID)
28 return res.status(HttpStatusCode.NOT_FOUND_404).end()
31 return res.json(mapToJSON(result))