JSPM

  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q59518F
  • License MIT

Linked Data Platform

Package Exports

  • ldnode

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ldnode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ldnode

Build Status NPM Version Gitter chat

Linked Data Platform server based on rdflib.js and node.js. This is all you need to run distributed linked data apps on top of the file system.

Features

  • GET, PUT and PATCH support
  • Proxy for cross-site data access
  • Access control using RDF ACLs
  • WebID Authentication
  • Real-time live updates (using websokets)
  • Mount as express' router

Install

npm install

Usage

Library

Simple

var ldnode = require('ldnode')

var ldp = ldnode.createServer({
  uri: "http://example.com/test/",
  base: __dirname + '/test/'
})
ldp.listen(1234, function() {
  // Started Linked Data Platform
})

Advanced

You can integrate it with your existing express app

var ldnode = require('ldnode')
var app = require('express')()
app.use('/test', ldnode(opts))
...
Logging

If you are running your own app

$ DEBUG="ldnode:*" node app.js

or simply

$ ldnode -v

Command line tool

npm install -g ldnode

The command line tool has the following options

Usage: ldnode [options]

Options:
   -v, --verbose   Print the logs to console
   --version       Print current ldnode version
   -u, --uri       Default address of the server (e.g. http[s]://host:port/path)
   -b, --base      Base location to serve resources
   -p, --port      Port to use
   -c, --cache     Set cache time (in seconds), 0 for no cache
   -K, --key       Path to the ssl key
   -C, --cert      Path to the ssl cert
   --webid         Enable WebID+TLS authentication
   -s, --secret    HTTP Session secret key (e.g. "your secret phrase")
   -s, --no-live   Disable live support through WebSockets

Tests

The tests assume that there is a running ldnode.

$ npm test
# running the tests with logs
$ DEBUG="ldnode:*" npm test

License

MIT