-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
44 lines (32 loc) · 1.07 KB
/
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
'esversion: 8';
const express = require('express');
const app = express();
const ldp = require("./index.js");
/******************************************/
var config = {
createIndexDoc: function(version) {
var index = {};
if (version.content.configType !== undefined) {
// This is a 'config' thing. A profile, probably.
index.resourceType = version.content.configType;
if (version.content.name !== undefined) {
index.label = version.content.name;
}
}
if (version.content.rdf) {
// We have a verso resource.
index.resourceType = "resource";
if (version.content.profile !== undefined) {
index.profile = version.content.profile;
}
var rdf = JSON.parse(version.content.rdf);
}
return index;
}
};
ldp.setConfig(config);
/******************************************/
app.use('/ldp', ldp);
app.listen(3000);
console.log("Listening on port 3000");
module.exports = ldp;