asyncapi-standalone-asserts

1.0.2 • Public • Published

Example

Site result: https://run.mocky.io/v3/c55fec65-1f0f-48b4-9295-4b2c95052e76

Web page

Mobile - Web page

Usage

<!doctype html>
<html lang="en">
  <head>
    <link href="https://unpkg.com/asyncapi-standalone-asserts@latest/css/global.min.css" rel="stylesheet">
    <link href="https://unpkg.com/asyncapi-standalone-asserts@latest/css/asyncapi.min.css" rel="stylesheet">
    <link href="https://unpkg.com/asyncapi-standalone-asserts@latest/css/loading.css" rel="stylesheet">
    <title>Loading ...</title>
    <meta charset="utf-8">
  </head>
  <body>
    <div id="root">
      <div style="text-align: center;">
        <div color="#32329f" class="eprxZf">Loading ...</div>
        <img class="gdZoGt" src="https://unpkg.com/asyncapi-standalone-asserts@latest/svg/loading.svg" />
      </div>
    </div>
    <script src="https://unpkg.com/@asyncapi/parser@latest/dist/bundle.js"></script>
    <script src="https://unpkg.com/asyncapi-standalone-asserts@latest/js/asyncapi-ui.min.js" type="application/javascript"></script>
    <script>
      async function start() {
        const url = 'https://raw.githubusercontent.com/asyncapi/asyncapi/2.0.0/examples/2.0.0/streetlights.yml'
        const parser = window['AsyncAPIParser'];
        const result = await parser.parseFromUrl(url); // YOUR URL (json/yml)
        const schema = result._json
        const config = {"show": {"sidebar": true},"sidebar": {"showOperations": "byDefault"}};
        AsyncApiStandalone.hydrate({ schema, config }, document.getElementById("root"));
      }
      start()
    </script>
  </body>
</html>

Readme

Keywords

none

Package Sidebar

Install

npm i asyncapi-standalone-asserts

Weekly Downloads

9

Version

1.0.2

License

ISC

Unpacked Size

497 kB

Total Files

9

Last publish

Collaborators

  • kevinbds