Skip to content

Commit a581e7b

Browse files
committedDec 19, 2014
Reformatting. Need for complete tests.
1 parent 82ef993 commit a581e7b

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed
 

‎samples/hello_scgi.ml

+10-17
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,31 @@
66
open Scgi
77
open Lwt
88

9-
let _ =
9+
let () =
1010
(* Command line options *)
1111
let port = ref 8080 in
1212
let addr = ref "127.0.0.1" in
1313

1414
Arg.parse
15-
(Arg.align
16-
["--port", Arg.Set_int port, Printf.sprintf " port number (default: %d)" !port;
17-
"--addr", Arg.Set_string addr, Printf.sprintf " ip address to bind (default: %s)" !addr;
18-
]
15+
(Arg.align [
16+
"--port", Arg.Set_int port,
17+
Printf.sprintf " port number (default: %d)" !port;
18+
19+
"--addr", Arg.Set_string addr,
20+
Printf.sprintf " ip address to bind (default: %s)" !addr;
21+
]
1922
)
2023
(fun s -> failwith (Printf.sprintf "Unknown argument: [%s]" s))
2124
"try --help";
2225

2326
(* Start the handler *)
24-
Server.handler_inet "hello" !addr !port (fun r ->
27+
let _server = Server.handler_inet "hello" !addr !port (fun r ->
2528
Lwt.return
2629
{ Response.status = `Ok;
2730
headers = [`Content_type "text/plain"];
2831
body = `String ("Hello world: " ^ Request.path r);
2932
}
30-
);
33+
) in
3134

3235
(* Run forever in foreground. *)
3336
Lwt_main.run (fst (Lwt.wait ()))
34-
35-
36-
37-
38-
39-
40-
41-
42-
43-

0 commit comments

Comments
 (0)
Please sign in to comment.