PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/server/server.ml

http://github.com/hhughes/ocaml-frui
OCaml | 36 lines | 15 code | 5 blank | 16 comment | 0 complexity | f3d871170e2c419fb00c61bec2b7c3e9 MD5 | raw file
 1(*pp camlp4o -I `ocamlfind query lwt.syntax` lwt-syntax-options.cma lwt-syntax.cma *)
 2
 3(*
 4 * Copyright (c) 2010 Anil Madhavapeddy <anil@recoil.org>
 5 *
 6 * Permission to use, copy, modify, and distribute this software for any
 7 * purpose with or without fee is hereby granted, provided that the above
 8 * copyright notice and this permission notice appear in all copies.
 9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *)
18
19open Printf
20open Lwt
21open Cohttp
22open Cohttpserver
23
24let _ =
25
26  Lwt_main.run ( 
27    let port = 8080 in
28    let spec = {
29      Http_daemon.default_spec with
30        Http_daemon.callback = Dispatch.t;
31        port = port
32    } 
33    in
34   
35    Http_daemon.main spec
36  )