Skip to content

tonsky/spectre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spectre

What is it?

Spectre is the general-purpose web application framework for Fantom language.

Main features

  • higly customizable;
  • batteries included: flexible url router, cookies, messages, custom sessions;
  • full-featured forms library;
  • Mustache templates for presentation layer;
  • development server with:
    • non-blocking IO cycle for perfect scalability;
    • WebSocket protocol draft 76 support;
    • instant app reload in dev mode.

Documentation

Spectre documentation can be found at spectreframework.org/documents/ or in a doc/ folder of Spectre distribution.

Sample application

using spectre

class HelloWorldApp : Settings {
  new make(Str:Obj? params) : super(params) {
    routes = Router {
      ["/*", |->Res| { Res("Hello, world!") }]
    }
  }
}

For more examples take a look at examples/ folder of Spectre distribution.

Building Spectre from sources

You’ll need:

Set up Fantom’s jdkHome property in $FAN_HOME/etc/build/config.props. Then run:

>>> fan printf/build.fan
>>> fan mustache/build.fan
>>> fan spectre/src/build.fan
>>> cp $FAN_HOME/lib/fan/printf.pod spectre/lib/fan/
>>> cp $FAN_HOME/lib/fan/mustache.pod spectre/lib/fan/
>>> cp $FAN_HOME/lib/fan/spectre.pod spectre/lib/fan/

Now add spectre/bin to your $PATH and that’s it.