-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
44 lines (40 loc) · 892 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const express = require('express');
const app = express();
const port = process.env.PORT || 5001;
const log = console.log;
const sampleImages = [
"/sample-images/1.png",
"/sample-images/2.png",
"/sample-images/3.png",
];
app.get('/videos', (req, res) => {
res.send({
userName: req.query.userName,
videos: [{
_id: 0,
name: 'vid1',
thumb: 'path',
path: 'path'
}, {
_id: 1,
name: 'vid2',
thumb: 'path',
path: 'path'
}]
});
});
app.get('/images', (req, res) => {
res.send({
userName: req.query.userName,
images: sampleImages
});
});
app.get('/record', (req, res) => {
const newFilename = 'recording-date-file';
log('Recording to file: ' + newFilename);
res.send({
userName: req.query.userName,
filename: newFilename
});
});
app.listen(port, () => console.log(`Listening on port ${port}`));