The purpose of this kata is to create a development server for our project.
The idea here is to expand on what was learned earlier and cover the following:
- Returning HTML from the server
- Understanding template literals at a basic level
- Defining custom components that use template literals
Complete the following:
- Create or expand the current server that returns a basic HTML document at
/
. - Apply
text/html; charset=utf-8
as theContent-Type
header of the returned document. Note how rendering changes at the browser. - Set up a file called
App.ts
, set up a function that returns<p>This is my page</p>
, and export it (export { App };
). Import the file to your server and render it through a template literal. - Optional - Look up ws module and expose a WebSocket from the server. Then set up a esbuild based build for the client portion and use Deno.watchFs to trigger it to refresh the client using
location.reload()
. Note that this is a highly advanced task and you should try it only if you have time and confidence with web technologies.