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

feat(redoc): add @hono/redoc middleware #892

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jonghyo
Copy link

@jonghyo jonghyo commented Dec 17, 2024

Add @hono/redoc Middleware

This pull request introduces the @hono/redoc middleware for Hono applications. With this addition:

You can integrate ReDoc into your Hono application to provide an interactive API documentation interface.
The middleware allows you to serve ReDoc on a specified route and read an OpenAPI Specification to render the documentation.
This enhances the API documentation experience by making it more accessible and easier to interact with.

baseApp
  .doc31('/doc', {
    openapi: '3.1.0',
    info: {
      title: 'API',
      version: '1.0.0',
    },
  })
  .get(
    '/ui',
    redoc({
      url: '/doc',
    }),
  )
image

You can added the ability to configure options for ReDoc.

baseApp
  .doc31('/doc', {
    openapi: '3.1.0',
    info: {
      title: 'API',
      version: '1.0.0',
    },
  })
  .get(
    '/ui',
    redoc({
      url: '/doc',
      theme: {
        colors: {
          primary: {
            main: '#FF0000',
          },
        },
        sidebar: {
          backgroundColor: '#FF0000',
        },
      },
    }),
  )
image

Copy link

changeset-bot bot commented Dec 17, 2024

🦋 Changeset detected

Latest commit: ccb0b9c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hono/redoc Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jonghyo jonghyo changed the title feat: add @hono/redoc feat: add @hono/redoc middleware Dec 17, 2024
@jonghyo jonghyo changed the title feat: add @hono/redoc middleware Draft: feat: add @hono/redoc middleware Dec 17, 2024
@jonghyo jonghyo changed the title Draft: feat: add @hono/redoc middleware feat(redoc): add @hono/redoc middleware Dec 18, 2024
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.

1 participant