RDF Serve
A static file serve with content negotiation for RDF.
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.