JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q38560F
  • License MIT

Queries the semantic web on your behalf

Package Exports

  • twinql-server

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 (twinql-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

twinql-server

Build Status Coverage Status

Places the twinql query engine behind an HTTP server.

What is this?

While twinql can run within client JS processes, the LDP backend implementation works by loading all the named graphs visited by the query at runtime. This results in a lot of network activity which may slow down clients with low bandwidth, especially mobile devices.

The twinql server process provides an endpoint to which clients can POST their twinql queries. The twinql server then runs the query and returns the response. Clients get just the data they request and nothing more.

Running

This package distributes a binary which you can install globally:

$ npm i -g twinql-server
$ twinql-server -h

  Usage: twinql-server [options]

  Options:

    -h, --help                       output usage information
    -V, --version                    output the version number
    -H, --hostname [value]           The hostname of this server
    -p, --port <n>                   The port this server should run on
    -r, --reverse-proxy-ip [value]   The trusted IP address of the reverse proxy.  Takes values accepted by https://expressjs.com/en/guide/behind-proxies.html
    -f, --forward-proxy-uri [value]  The URI of the forward-facing Solid agent

It's best to run this behind a reverse proxy to provide HTTPS.

If you want the twinql engine to use an authenticated agent to fetch on behalf of the client, provide a --forward-proxy-uri.

Developing

Please submit Github issues, and we can work together to address them!

When making code changes the server is in the lib/ directory, the binary is in the bin/ directory, and the tests are in the test/ directory. If you'd like to make a code change make sure you add tests and run npm test before submitting a PR. And don't forget to npm i initially.