@scalar/hono-api-reference 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Scalar Hono API Reference Plugin
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
3
|
+
[](https://www.npmjs.com/package/@scalar/hono-api-reference)
|
|
4
|
+
[](https://www.npmjs.com/package/@scalar/hono-api-reference)
|
|
5
|
+
[](https://www.npmjs.com/package/@scalar/hono-api-reference)
|
|
6
6
|
[](https://discord.gg/8HeZcRGPFS)
|
|
7
7
|
|
|
8
8
|
This middleware provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger file with Hono.
|
|
9
9
|
|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
## Installation
|
|
11
13
|
|
|
12
14
|
```bash
|
|
@@ -32,6 +34,24 @@ app.get(
|
|
|
32
34
|
|
|
33
35
|
The Hono middleware takes our universal configuration object, [read more about configuration](https://github.com/scalar/scalar/tree/main/packages/api-reference#props) in the core package README.
|
|
34
36
|
|
|
37
|
+
### Themes
|
|
38
|
+
|
|
39
|
+
The middleware comes with a custom theme for Hono. You can use one of [the other predefined themes](https://github.com/scalar/scalar/blob/main/packages/themes/src/index.ts#L15) (`alternate`, `default`, `moon`, `purple`, `solarized`) or overwrite it with `none`. All themes come with a light and dark color scheme.
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { apiReference } from '@scalar/hono-api-reference'
|
|
43
|
+
|
|
44
|
+
app.get(
|
|
45
|
+
'/reference',
|
|
46
|
+
apiReference({
|
|
47
|
+
theme: 'purple',
|
|
48
|
+
spec: {
|
|
49
|
+
url: '/swagger.json',
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
35
55
|
### Custom page title
|
|
36
56
|
|
|
37
57
|
There’s one additional option to set the page title:
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalar/hono-api-reference",
|
|
3
3
|
"description": "A middleware for using the Scalar API reference in Hono",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@scalar/api-reference": "1.0.
|
|
6
|
+
"@scalar/api-reference": "1.0.4"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"hono": "3.9.2",
|