r2-streamer-js
r2-streamer-js copied to clipboard
Add 'readers' config to Server
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.
This should also close https://github.com/readium/r2-streamer-js/issues/46