openapi.yaml 으로 api docs 사이트 생성하기

index.html

<!doctype html>
<html>
  <head>
    <link
      rel="stylesheet"
      href="https://unpkg.com/swagger-ui-dist/swagger-ui.css"
    />
  </head>
  <body>
    <div id="swagger-ui"></div>
    <script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script>
    <script>
      SwaggerUIBundle({
        url: "./openapi.yaml",
        dom_id: "#swagger-ui",
      });
    </script>
  </body>
</html>

해당 index.html 파일과 openapi.yaml 파일을 같은 위치에 두고, http-server로 실행한다.

위로 스크롤