pod wisp

Wisp web Server

Mixins

WispSessionStore

Pluggable hooks for Wisp session storage.

Classes

WispDefaultErrMod

WispDefaultErrMod

WispService

Simple web server services HTTP requests on a configured port to a top-level root WebMod.

Overview

Fantom comes bundled with the WispService which implements a web server purely in Fantom code - so you can use it without the fuss of setting up additional software.

Test Setup

You can run a test wisp server straight from fansh using a configurable port:

fansh> wisp::WispService { port = 8080 }.start
fan.wisp.WispService@5a9de6
[16:22:49 30-Nov-09] [info] [web] WispService started on port 8080

If it is running correctly you should be able to hit http://localhost:8080/ and see the test page.

Configuration

Wisp is easily configured by installing a root WebMod which is responsible for serving all requests to the server. Typically you will install a composition WebMod to setup your pipeline and routing configuration.

See the following examples for how to setup a daemon script with various WebMod configurations:

wisp::Main

For the common case where a single WebMod is used, wisp can be run directly from the command line:

$ fan wisp
Usage:
  wisp [options] <mod>
Arguments:
  mod    qualified type name for WebMod to run
Options:
  -help, -?      Print usage help
  -port <Int>    http port (default 8080)

For example:

$ fan wisp myPod::MyWebMod
[16:43:16 24-Aug-12] [info] [web] WispService started on port 8080