Kevin TaleK
Denoβ€’14mo agoβ€’
29 replies
Kevin Tale

How to add a simple live reload?

Consider this super simple codebase

app/
  index.html
  main.ts

// main.ts
const content = Deno.readTextFileSync("./index.html");

Deno.serve(() => new Response(content, {
        headers: { "Content-Type": "text/html" },
    })
);

// index.html
<p>Hello world</p>


Then I run deno run -A -r --watch main.ts.

http://localhost:8000/ will correctly serve my html content but how can I enable somekind of live reload where if I edit my
index.html
in VSCode it will effectively show the updated
index.html
in my browser?

thanks
Was this page helpful?