* JavaScript

  ```js
  export default {
    async fetch(request) {
      const html = `<!DOCTYPE html>
      <body>
        <h1>Hello World</h1>
        <p>This markup was generated by a Cloudflare Worker.</p>
      </body>`;


      return new Response(html, {
        headers: {
          "content-type": "text/html;charset=UTF-8",
        },
      });
    },
  };
  ```

  [Run Worker in Playground](https://workers.cloudflare.com/playground#LYVwNgLglgDghgJwgegGYHsHALQBM4RwDcABAEbogB2+CAngLzbPYZb6HbW5QDGU2AAyCAzACZBAdikBOEcIBcLFm2Ac4XGnwHDxU2fMEBYAFABhdFQgBTK9gAiUAM4x0TqNEsKSqvAWIkVHDA1gwARFA01gAeAHQAVk5hpKhQYLbBoRFRcYlhphZWthDYACp0MNbecDAwYHwEUJbI8XAAbnBOvAiwEADUwOi44NampjGuSCS41qhw4BAkAN4mJCSddFS8PtYQvAAWABQI1gCOINZOEACUy6trJLyWVyT7EMBgJAwkAAYAPABCewAeTMpQAmgAFACir3eYAAfPc1n8KLg6EiHg8-vsAIwIgAS1jAYHQJAA6pgwLg-sg8ZisSQ-jAEaV9s4SMBEABrEAwEgAd06JAA5rZrAgCNZcOQ6OsSGZSSBcKgwIhrBTMNyJbFaSzkUzkGiMT8iCYDScICAEFRAtYBSQAEqXVxUJzWQ5vD4AGjujNe1jgMwQTm8K39azCTyKdggFWsYW8YRs0RQXrARAOiHdEAYAFVSgAxbAADjC3oNawAvhWsVXrmbqxWq0RTMpmKp1JoePwhKIJNJJHJhAVLDY7I4XG4PE0qN5fOpSEEQuEQoR1MkfGkMiuwmRSWR8uYx8UyvHqrV6rxGs1EpYxiYlmEuZEAPqDYbpRPZGa5JJVtt207fxu20Ps9EHYdBGYIA)

* TypeScript

  ```ts
  export default {
    async fetch(request): Promise<Response> {
      const html = `<!DOCTYPE html>
      <body>
        <h1>Hello World</h1>
        <p>This markup was generated by a Cloudflare Worker.</p>
      </body>`;


      return new Response(html, {
        headers: {
          "content-type": "text/html;charset=UTF-8",
        },
      });
    },
  } satisfies ExportedHandler;
  ```

* Python

  ```py
  from workers import Response


  def on_fetch(request):
      html = """<!DOCTYPE html>
      <body>
        <h1>Hello World</h1>
        <p>This markup was generated by a Cloudflare Worker.</p>
      </body>"""


      headers = {"content-type": "text/html;charset=UTF-8"}
      return Response(html, headers=headers)
  ```

* Rust

  ```rs
  use worker::*;


  #[event(fetch)]
  async fn fetch(_req: Request, _env: Env, _ctx: Context) -> Result<Response> {
      let html = r#"<!DOCTYPE html>
      <body>
        <h1>Hello World</h1>
        <p>This markup was generated by a Cloudflare Worker.</p>
      </body>
      "#;
      Response::from_html(html)
  }
  ```

* Hono

  ```ts
  import { Hono } from "hono";
  import { html } from "hono/html";


  const app = new Hono();


  app.get("*", (c) => {
    const doc = html`<!DOCTYPE html>
      <body>
        <h1>Hello World</h1>
        <p>This markup was generated by a Cloudflare Worker with Hono.</p>
      </body>`;


    return c.html(doc);
  });


  export default app;
  ```
