Currently the URL to the scalar bundle is hardcoded to the jsdeliver.net CDN. This PR added an additional option (scalarCDN) so the URL to the scalar bundle can be explicitly set. This is useful if a user wishes to host the scalar bundle themselves. When the scalarCDN option is set, the scalarVersion is ignored.
This change maintains backwards compatibility, and users who have scalarVersion set, will still get the scalar bundle from the default jsdelivr.net CDN.
Example usage:
const server = new Elysia().use(html).use(
swagger({
provider: "scalar",
scalarCDN: "https://unpkg.com/@scalar/api-reference@1.13.10/dist/browser/standalone.js"
//scalarCDN: "/public/standalone.min.js" //Served locally
})
);
Currently the URL to the scalar bundle is hardcoded to the jsdeliver.net CDN. This PR added an additional option (
scalarCDN
) so the URL to the scalar bundle can be explicitly set. This is useful if a user wishes to host the scalar bundle themselves. When thescalarCDN
option is set, thescalarVersion
is ignored.This change maintains backwards compatibility, and users who have
scalarVersion
set, will still get the scalar bundle from the default jsdelivr.net CDN.Example usage: