yusukebe / hono-playground

Home Page:https://playground.hono.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hono Playground

The Hono Playground is a web page that allows you to run a Hono app in your browser without a server.

We know that Hono works on server sides - Cloudflare Workers, Fastly Compute@Edge, Deno, Bun, and Node.js. However, Hono also works on browsers as it is composed of only Web-standards APIs.

This may seem obvious, but it's exciting to see it actually work in this manner. You can experience it at this URL: https://playground.hono.dev/

Screenshots

SS

The minimal code

This is a minimal code to run a Hono app on browsers.

<html>
  <head>
    <script type="module">
      import { Hono } from 'https://esm.sh/hono'
      const app = new Hono()
      app.get('*', (c) => c.text(`You are accessing ${c.req.path}`))
      const res = await app.request(location.href)
      document.getElementById('result').innerText = await res.text()
    </script>
  </head>
  <body>
    <div id="result"></div>
  </body>
</html>

Author

Yusuke Wada https://github.com/yusukebe

License

MIT


Monaco Editor

The MIT License (MIT)

Copyright (c) 2016 - present Microsoft Corporation

About

https://playground.hono.dev


Languages

Language:HTML 84.8%Language:CSS 15.2%