Skip to content

Commit 6dd0e57

Browse files
committed
Removed file initalization and inserted into OSLC Service
1 parent 36fad66 commit 6dd0e57

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

service.js

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -798,54 +798,8 @@ module.exports = function(env) {
798798
console.error("Can't initialize MongoDB.");
799799
return;
800800
}
801-
// create root container if it doesn't exist
802-
db.get(env.ldpBase, function(err, document) {
803-
if (err) {
804-
console.log(err.stack);
805-
return;
806-
}
807-
808-
if (!document || document.deleted) {
809-
createRootContainer(function(err) {
810-
if (err) {
811-
console.log(err.stack);
812-
}
813-
});
814-
}
815-
});
801+
816802
});
817803
return ldpRoutes(db, env);
818804

819-
// creates a root container on first run
820-
function createRootContainer(callback) {
821-
var triples = [{
822-
subject: env.ldpBase,
823-
predicate: rdf.type,
824-
object: ldp.Resource
825-
}, {
826-
subject: env.ldpBase,
827-
predicate: rdf.type,
828-
object: ldp.RDFSource
829-
}, {
830-
subject: env.ldpBase,
831-
predicate: rdf.type,
832-
object: ldp.Container
833-
}, {
834-
subject: env.ldpBase,
835-
predicate: rdf.type,
836-
object: ldp.BasicContainer
837-
}, {
838-
subject: env.ldpBase,
839-
predicate: 'http://purl.org/dc/terms/title',
840-
object: '"LDP.js root container"'
841-
}];
842-
843-
db.put({
844-
name: env.ldpBase,
845-
interactionModel: ldp.BasicContainer,
846-
triples: triples,
847-
deleted: false
848-
}, callback);
849-
}
850-
851805
}

0 commit comments

Comments
 (0)