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