Files
talk/routes/api/stream/index.js
T

35 lines
827 B
JavaScript

const express = require('express');
const router = express.Router();
router.get('/', (req, res) => {
console.log('Stream endpoint has been hit with asset_id ', req.query.asset_id)
res.setHeader('Content-Type', 'application/json');
res.send(JSON.stringify([
{
'id': 'abc',
'type': 'comment',
'body': 'Sample comment',
'created_at': new Date().getTime(),
'asset_id': 'assetTest'
},
{
'id': 'xyz',
'type': 'comment',
'body': 'Sample reply',
'created_at': new Date().getTime() - 600000,
'parent_id': 'abc',
'asset_id': 'assetTest'
},
{
'id': 'def',
'type': 'comment',
'body': 'Another comment',
'created_at': new Date().getTime() - 400000,
'asset_id': 'assetTest'
}
]));
});
module.exports = router;