Link-based Resource Descriptor Document (LRDD) middleware for Connect.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/host-meta
lib
support/mk
test
.gitignore
.jshintrc
.npmignore
.travis.yml
LICENSE
Makefile
README.md
package.json

README.md

connect-lrdd

Build Coverage Quality Dependencies

Link-based Resource Descriptor Document (LRDD) middleware middleware for Connect and Express.

LRDD is a mechanism used to discover metadata about resources available on the Internet. It defines the protocol and document formats used for other discovery protocols such as Web Host Metadata and WebFinger.

Install

$ npm install connect-lrdd

Usage

Middleware

To service LRDD requests, use lrdd.descriptor() middleware in your application.

app.get('/lrdd', lrdd.descriptor(function(uri, done) {
  Resource.findByUri({ uri: uri }, function (err, resource) {
    if (err) { return done(err); }
    var desc = new lrdd.Descriptor(uri);
    // add properties and links to descriptor...
    return done(null, desc);
  });
}));

The function supplied to lrdd.descriptor() takes uri and a done callback as arguments. uri identifies a resource available at the host. done is a callback which should be called with descriptor for the resource. If an exception occurred, err should be set.

Examples

For a complete, working example, refer to the host-meta example.

Tests

$ npm install
$ npm test

Credits

License

The MIT License

Copyright (c) 2011-2014 Jared Hanson <http://jaredhanson.net/>