-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
110 lines (91 loc) · 2.75 KB
/
index.js
File metadata and controls
110 lines (91 loc) · 2.75 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
const express = require('express');
const fs = require('fs');
const app = express();
//var matroska = require('matroska');
app.get('/video1', (req,res)=>{
fs.readFile('./src/video1.mp4', function(err, data){
res.writeHead(200, {'Content-Type': 'video/mp4'});
res.write(data);
res.end();
});
});
app.get('/video1_img', (req,res)=>{
fs.readFile('./src/video1_img.jpg',function(err,data){
res.writeHead(200, {'Content-Type': 'image/jpg'});
res.write(data);
res.end();
})
});
app.get('/video2', (req,res)=>{
fs.readFile('./src/video2.mp4', function(err, data){
res.writeHead(200, {'Content-Type': 'video/mp4'});
res.write(data);
res.end();
});
});
app.get('/video2_img', (req,res)=>{
fs.readFile('./src/video2_img.jpg',function(err,data){
res.writeHead(200, {'Content-Type': 'image/jpg'});
res.write(data);
res.end();
})
});
app.get('/video3', (req,res)=>{
fs.readFile('./src/video3.mp4', function(err, data){
res.writeHead(200, {'Content-Type': 'video/mp4'});
res.write(data);
res.end();
});
});
app.get('/video3_img', (req,res)=>{
fs.readFile('./src/video3_img.jpg',function(err,data){
res.writeHead(200, {'Content-Type': 'image/jpg'});
res.write(data);
res.end();
})
});
app.get('/video4', (req,res)=>{
fs.readFile('./src/video4.mp4', function(err, data){
res.writeHead(200, {'Content-Type': 'video/mp4'});
res.write(data);
res.end();
});
});
app.get('/video4_img', (req,res)=>{
fs.readFile('./src/video4_img.jpg',function(err,data){
res.writeHead(200, {'Content-Type': 'image/jpg'});
res.write(data);
res.end();
})
});
app.get('/video5', (req,res)=>{
fs.readFile('./src/video5.mp4', function(err, data){
res.writeHead(200, {'Content-Type': 'video/mp4'});
res.write(data);
res.end();
});
});
app.get('/video5_img', (req,res)=>{
fs.readFile('./src/video5_img.jpg',function(err,data){
res.writeHead(200, {'Content-Type': 'image/jpg'});
res.write(data);
res.end();
})
});
app.get('/video6', (req,res)=>{
fs.readFile('./src/video6.mp4', function(err, data){
res.writeHead(200, {'Content-Type': 'video/mp4'});
res.write(data);
res.end();
});
});
app.get('/video6_img', (req,res)=>{
fs.readFile('./src/video6_img.jpg',function(err,data){
res.writeHead(200, {'Content-Type': 'image/jpg'});
res.write(data);
res.end();
})
});
app.listen('9000',()=>{
console.log('Server running at http://localhost:9000/');
});