bidi-hello-world

Another simple website that displays "Hello World!".

This introduces a router component which dispatches incoming HTTP requests to one of its dependant components providing routes.

This demonstrates one of the principles of modularity. We avoid a single data structure comprising all the HTTP routes in a system. Rather, we allow individual modules to make contributions to this route structure.

bidi is used in this example, but the principle would be the same using Compojure routes, which supports similar composeable mechanisms.

Incantation

To create a project called foo based on this template, type this in a command line shell :-

lein new modular foo bidi-hello-world

Modules

component

http-listener

modular-bidi-router

simple-bidi-website

Components

modular.bidi/router

modular.http-kit/webserver

Additional libraries

[com.stuartsierra/component "0.2.2"]

Custom files

src/foo/simple_bidi_website.clj


Modularity
Copyright © 2015, LTD.