Skip to content

Latest commit

 

History

History
87 lines (67 loc) · 1.26 KB

QuickStart.md

File metadata and controls

87 lines (67 loc) · 1.26 KB

Quick Start

Installing

Setup

  1. Ensure "{home}/bin" is in your path
  2. Fantom launcher:
    • Unix: "bin/fan" bash script
    • Windows: "bin/fan.exe" executable
  3. Verify setup "fan -version"

For further information see Setup

Hello World

The hello.fanx file:

  class Hello {
  	fun main() { echo("Hello World") }
  }

Run:

  fan hello.fanx

Hello World GUI

using vaseGui

class HelloTest
{
  static fun main() {
    root := Frame {
      Button {
        text = "Press Me"
        onClick {
          Toast("Hello World").show(it)
        }
      },
    }
    root.show
  }
}

Hello World Web

File './public/hello.fanx':


using slanWeb

class Hello : SlanWeblet
{
  fun hi()
  {
    setContentType("html")
    res.out.print("<h2>Hello World!</h2>")
  }
}

run server:

fan slanWeb -resPath public/

You should be able to hit http://localhost:8080/ with your browser!

API Docs

generate the HTML docs

  fan compilerDoc -all

This will generate the HTML docs for all the pods found in your local working environment.

Learning Fanx