r2-streamer-js icon indicating copy to clipboard operation
r2-streamer-js copied to clipboard

Add 'readers' config to Server

Open kristojorg opened this issue 4 years ago • 1 comments

This PR adds a simple configuration option to server.ts allowing a user to pass in an array of example readers which will then be shown on the /pub/:pubId page. This allows us to show different reader examples in that space that match our setup. It is used like this:

  const server = new Server({
    readers: [
      {
        title: "Dita Example",
        getUrl: (url) => `/viewer/index.html?url=${url}`,
      },
      {
        title: "Minimal",
        getUrl: (url) => `/viewer/index_minimal.html?url=${url}`,
      },
    ],
  });

If nothing is passed, the default readers will be used.

kristojorg avatar Jul 02 '21 12:07 kristojorg

This should also close https://github.com/readium/r2-streamer-js/issues/46

kristojorg avatar Jul 02 '21 16:07 kristojorg