rgrinberg / opium

Sinatra like web toolkit for OCaml
MIT License
755 stars 67 forks source link

try to change port in app code #38

Closed nodrygo closed 9 years ago

nodrygo commented 9 years ago

please what am I doing wrong please?

I am new in OCaml and playing with opium I am trying to change port in code like that

let app =    
        App.empty   
        |> middleware uppercase   
        |> home
        |> hello
        |> vers
        |> App.cmd_name "demo1"
let _ = 
    let localport = 8000 in 
    printf "Run server on port %d \n" localport ; flush stdout ;
    app |> App.port localport |>  App.run_command

but I got

./demo1.native -v
Run server on port 8000 
demo1.native: main: Running on port: 3000

thanks

rgrinberg commented 9 years ago

I fixed this in master. Will push out a bug fix release. In the meantime you can: