Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@scalar/hono-api-reference
Advanced tools
This middleware provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger document with Hono.
npm install @scalar/hono-api-reference
Set up Zod OpenAPI Hono and pass the configured URL to the apiReference
middleware:
import { apiReference } from '@scalar/hono-api-reference'
app.get(
'/reference',
apiReference({
spec: {
url: '/openapi.json',
},
}),
)
The Hono middleware takes our universal configuration object, read more about configuration in the core package README.
The middleware comes with a custom theme for Hono. You can use one of the other predefined themes (alternate
, default
, moon
, purple
, solarized
) or overwrite it with none
. All themes come with a light and dark color scheme.
import { apiReference } from '@scalar/hono-api-reference'
app.get(
'/reference',
apiReference({
theme: 'purple',
spec: {
url: '/openapi.json',
},
}),
)
There’s one additional option to set the page title:
import { apiReference } from '@scalar/hono-api-reference'
app.get(
'/reference',
apiReference({
pageTitle: 'Hono API Reference',
spec: {
url: '/openapi.json',
},
}),
)
You can use a custom CDN ,default is https://cdn.jsdelivr.net/npm/@scalar/api-reference
.
You can also pin the CDN to a specific version by specifying it in the CDN string like https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.28
You can find all available CDN versions here
import { apiReference } from '@scalar/hono-api-reference'
app.use(
'/reference',
apiReference({
cdn: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference@latest',
spec: {
content: OpenApiSpecification,
},
}),
)
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
The source code in this repository is licensed under MIT.
FAQs
A middleware for using the Scalar API reference in Hono
The npm package @scalar/hono-api-reference receives a total of 0 weekly downloads. As such, @scalar/hono-api-reference popularity was classified as not popular.
We found that @scalar/hono-api-reference demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.