Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Hello world in Superscribe - F# style
<?xml version="1.0" encoding="utf-8"?>
<package id="Microsoft.Owin" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="3.0.0" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Superscribe" version="" targetFramework="net45" />
<package id="Superscribe.Owin" version="" targetFramework="net45" />
namespace Server
open Owin
open Microsoft.Owin
open Superscribe.Owin
open Superscribe.Owin.Engine
open Superscribe.Owin.Extensions;
type Startup() =
member x.Configuration(app: Owin.IAppBuilder) =
let define = OwinRouteEngineFactory.Create();
app.UseSuperscribeRouter(define).UseSuperscribeHandler(define) |> ignore
define.Route("/hello/world", fun _ -> "Hello World" :> obj) |> ignore
define.Route("/hello/fsharp", fun _ -> "Hello from F#!" :> obj) |> ignore
[<assembly: OwinStartup(typeof<Startup>)>]
do ()
open System
open Microsoft.Owin
let main argv =
let baseAddress = "http://localhost:8888";
use a = Hosting.WebApp.Start<Server.Startup>(baseAddress)
Console.WriteLine("Server running on {0}", baseAddress)
Console.ReadLine() |> ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment