Last active
July 24, 2018 11:17
-
-
Save kunjee17/8d61ef831736984b8e5dd088e0987b22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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