Host Module

Essentially the __Host Module__ is the wiki server broken into packages. That is it is responsible for loading an http server - the deno standard server - and bootstraps the initiation of the outposts wiki client (the view module). This bootstrapping is described on this page. I try to translate Wards text which is shorter and more poetic.

Having loaded the deno standard server, the host module provides the initial html to the browser, and then responding to the http request of the browser that loads the initial html to deliver the view module.

DOT FROM module-diagram

The host.js module launches the View Module within the visitor's browser and then supports it and any other federation site by delivering pages on request - github

Called by the Start Module to handle web requests.

The host represents the persistent state of wiki sites. Requests can come from a client launched by the server or from other clients within the federation or beyond.

# Code The __Host Module__ is very readable and only 72 lines long: - Host.js code on gitub

# Code walkthrough

- Early the code loads the deno standard server for Headers required in responses we send to the clients and imports the view module in the html we provide - github

- The code provides simple routing in conformance with the basic fedwiki server requirement - github

- the code specifies a welcome route which delivers a small html file to load and run view.js - github

function client() { return `<html> <body> <script type=module> import { start } from "./view.js" start() </script> </body> </html>` }

- Answers a call to load the view.js javascript into the browser that is triggered when the browser loads the initial html - github

- provides a route which delivers the favicon flag that represents a site - github

- Answers a page encoded in the JSON page schema. This function is poorly named `variable` - github

# Not implemented yet - The deno server should provide a sitemap identifying available pages. Currently it does not generate this content - github

# See also