* 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+CAngLzbPYZb6HbW5QDGU2AAwAOAMyCALIIDswgJyy5ALhYs2wDnC40+AkeKmLFAWABQAYXRUIAU2vYAIlADOMdM6jQrSkurwFiEio4YBsGACIoGhsADwA6ACtncNJUKDA7ELDI6Pik8LNLazsIbAAVOhgbHzgYGDA+AigrZAS4ADc4Z14EWAgAamB0XHAbMzNYtyQSXBtUOHAIEgBvUxISLroqXl8bCF4ACwAKBBsARxAbZwgAShW19ZJeK2uSA4hgMBIGEgADAB4AIQOADy5jKAE0AAoAUTeHzAAD4Hut-hRcHRkY9Hv8DgBGREACRsYDA6BIAHVMGBcP9kPisdiSP8YIiygcXCRgIgANYgGAkADuXRIAHM7DYEAQbLhyHQNiRzGSQLhUGBEDZKZgeZK4nTWSjmch0ZjfkRTIbThAQAgqEEbIKSAAlK5uKjOGxHd6fAA09yZbxscFmCGcPlWAfW4WexXsEEqNnCPnCthiKG9YCIh0QHogDAAqmUAGLYYThH2G9YAXwr2KrN3N1YrVaIZlUzHUmm0PH4QjEkhk8hMFistnsTlc7k8zSoPj8mlIwVCEVChE0KV86Uyy-CZDJZAKI9jpQqVRqdQavCaLSSVnGpmW4W5UQA+kMRhkkzlZnlklW2+2nYBN2uh9gYg4KPIzBAA)

* 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)
  }
  ```
