Skip to content

Instantly share code, notes, and snippets.

@kunjee17
Last active July 24, 2018 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunjee17/8d61ef831736984b8e5dd088e0987b22 to your computer and use it in GitHub Desktop.
Save kunjee17/8d61ef831736984b8e5dd088e0987b22 to your computer and use it in GitHub Desktop.
module viewfiles.Main
open System
open Nancy.Hosting
type DemoApp () =
inherit NancyModule()
do
let Get = base.Get
Get.["/"] <- fun parameters -> "Hello from Nancy" :> obj
[<EntryPoint>]
let main args =
let env_port = Environment.GetEnvironmentVariable("PORT")
let port = if env_port = null then "1234" else env_port
let nancy_host = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:" + port))
nancy_host.Start()
while true do Console.ReadLine() |> ignore
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment