rdf-serve
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

RDF Serve

A static file serve with content negotiation for RDF.

GitHub license npm version build Dependabot semantic-release

Usage

The default export is a function called rdfServe which creates an express app serving documents at whichever base path you input

import rdfServe from 'rdf-serve';

const app = rdfServe(path.join(__dirname, 'myFiles'));
app.listen(3005);

We also include the function negotiateHandlerFactory to allow the content negotiation to be included in your own express app

import { negotiateHandlerFactory } from 'rdf-serve';
import express from 'express';

const app = express();
app.get("*", negotiateHandlerFactory(path.join(__dirname, 'myFiles')));
app.listen(3005);

Cli Usage

To serve the contents of ./myFiles run

rdf-serve ./myFiles

to specify the port these files should be served on run

rdf-serve ./myFiles -p 3005

to include ldp:contains triples on containers

rdf-serve ./myFiles -l

License

©2023–present Jesse Wright, MIT License.

/rdf-serve/

    Package Sidebar

    Install

    npm i rdf-serve

    Weekly Downloads

    34

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    11.9 kB

    Total Files

    7

    Last publish

    Collaborators

    • jeswr