Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalar CDN Option #95

Merged
merged 5 commits into from
Jan 24, 2024
Merged

Scalar CDN Option #95

merged 5 commits into from
Jan 24, 2024

Conversation

jmcudd
Copy link
Contributor

@jmcudd jmcudd commented Jan 18, 2024

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/[email protected]/dist/browser/standalone.js"
    //scalarCDN: "/public/standalone.min.js" //Served locally
  })
);

@SaltyAom SaltyAom merged commit d8e7294 into elysiajs:main Jan 24, 2024
1 check passed
@jmcudd jmcudd deleted the scalar-cdn branch January 24, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants