forked from cs3org/OCM-stub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-http.js
More file actions
30 lines (28 loc) · 802 Bytes
/
index-http.js
File metadata and controls
30 lines (28 loc) · 802 Bytes
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
const http = require('http');
const server = http.createServer((req, res) => {
console.log(req.method, req.url, req.headers);
req.on('data', (chunk) => {
console.log('CHUNK', chunk.toString());
});
req.on('end', () => {
if (req.url === '//ocs-provider/') {
console.log('yes //ocs-provider/');
res.end(JSON.stringify({
version: 2,
services: {
FEDERATED_SHARING: {
version: 1,
endpoints: {
share: "/ocs/v2.php/cloud/shares",
webdav: "/public.php/webdav/"
}
},
}
}));
} else {
console.log('not recognized');
res.end('OK');
}
});
});
server.listen(3000);