From e872f52e9775a330fe15cc09c7e536a32892e30b Mon Sep 17 00:00:00 2001 From: Swrup Date: Sat, 13 Sep 2025 15:56:19 +0200 Subject: [PATCH] init --- .gitignore | 1 + .ocamlformat | 13 +++++++++++++ dune-project | 26 ++++++++++++++++++++++++++ mte.opam | 32 ++++++++++++++++++++++++++++++++ src/assets/privacy.html | 11 +++++++++++ src/assets/terms.html | 11 +++++++++++ src/dune | 4 ++++ src/mte.ml | 18 ++++++++++++++++++ 8 files changed, 116 insertions(+) create mode 100644 .gitignore create mode 100644 .ocamlformat create mode 100644 dune-project create mode 100644 mte.opam create mode 100644 src/assets/privacy.html create mode 100644 src/assets/terms.html create mode 100644 src/dune create mode 100644 src/mte.ml diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e35d8850 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +_build diff --git a/.ocamlformat b/.ocamlformat new file mode 100644 index 00000000..9db5b95d --- /dev/null +++ b/.ocamlformat @@ -0,0 +1,13 @@ +version=0.27.0 +exp-grouping=preserve +break-infix=wrap-or-vertical +break-collection-expressions=wrap +break-sequences=false +break-infix-before-func=false +dock-collection-brackets=true +break-separators=before +field-space=tight +if-then-else=compact +break-sequences=false +sequence-blank-line=compact +exp-grouping=preserve diff --git a/dune-project b/dune-project new file mode 100644 index 00000000..544295f0 --- /dev/null +++ b/dune-project @@ -0,0 +1,26 @@ +(lang dune 3.20) + +(name mte) + +(generate_opam_files true) + +(source + (github username/reponame)) + +(authors "Author Name ") + +(maintainers "Maintainer Name ") + +(license LICENSE) + +(documentation https://url/to/documentation) + +(package + (name mte) + (synopsis "A short synopsis") + (description "A longer description") + (depends ocaml) + (tags + ("add topics" "to describe" your project))) + +; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/mte.opam b/mte.opam new file mode 100644 index 00000000..a43bbcb1 --- /dev/null +++ b/mte.opam @@ -0,0 +1,32 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "A short synopsis" +description: "A longer description" +maintainer: ["Maintainer Name "] +authors: ["Author Name "] +license: "LICENSE" +tags: ["add topics" "to describe" "your" "project"] +homepage: "https://github.com/username/reponame" +doc: "https://url/to/documentation" +bug-reports: "https://github.com/username/reponame/issues" +depends: [ + "dune" {>= "3.20"} + "ocaml" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/username/reponame.git" +x-maintenance-intent: ["(latest)"] diff --git a/src/assets/privacy.html b/src/assets/privacy.html new file mode 100644 index 00000000..c9378279 --- /dev/null +++ b/src/assets/privacy.html @@ -0,0 +1,11 @@ + + + + + MTE privacy policy + + +

MTE privacy policy

+ TODO + + diff --git a/src/assets/terms.html b/src/assets/terms.html new file mode 100644 index 00000000..829f6b79 --- /dev/null +++ b/src/assets/terms.html @@ -0,0 +1,11 @@ + + + + + MTE terms + + +

MTE terms

+ TODO + + diff --git a/src/dune b/src/dune new file mode 100644 index 00000000..b9b1fc67 --- /dev/null +++ b/src/dune @@ -0,0 +1,4 @@ +(executable + (public_name mte) + (name mte) + (libraries vif fmt jsont)) diff --git a/src/mte.ml b/src/mte.ml new file mode 100644 index 00000000..d169c878 --- /dev/null +++ b/src/mte.ml @@ -0,0 +1,18 @@ +let terms req _server _ = + Vif.Response.with_file ~compression:`DEFLATE req + Fpath.(v "assets" / "terms.html") + +let privacy req _server _ = + Vif.Response.with_file ~compression:`DEFLATE req + Fpath.(v "assets" / "privacy.html") + +let routes = + let open Vif.Uri in + let open Vif.Route in + (*let open Vif.Type in*) + [ + get (rel / "terms" /?? nil) --> terms + ; get (rel / "privacy" /?? nil) --> privacy + ] + +let () = Miou_unix.run @@ fun () -> Vif.run routes ()