example.com -> example.org
[Seppo.git] / chkr / apchk.ml
blobce4059bebfaa8d95a701f7314e674311672432e4
1 (*
2 * _ _ ____ _
3 * _| || |_/ ___| ___ _ __ _ __ ___ | |
4 * |_ .. _\___ \ / _ \ '_ \| '_ \ / _ \| |
5 * |_ _|___) | __/ |_) | |_) | (_) |_|
6 * |_||_| |____/ \___| .__/| .__/ \___/(_)
7 * |_| |_|
9 * Personal Social Web.
11 * Copyright (C) The #Seppo contributors. All rights reserved.
13 * This program is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 let () =
28 let module Cg = Seppo_lib.Cgi in
29 let module L = Seppo_lib.Logr in
30 Mirage_crypto_rng_lwt.initialize (module Mirage_crypto_rng.Fortuna);
31 (match Cg.Request.(from_env () |> consolidate |> proxy) with
32 | Error _ -> Sys.argv
33 |> Array.to_list
34 |> Shell.exec
35 | Ok req ->
36 let uuid = Uuidm.v `V4 in
37 req
38 |> Cgi.handle uuid stdin
39 |> Cg.Response.flush uuid stdout)
40 |> exit