package forester

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file Router.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(*
 * SPDX-FileCopyrightText: 2024 The Forester Project Contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *)

open Routes

type route =
  | Index
  | Font of string
  | Js_bundle
  | Stylesheet
  | Favicon
  | Tree of string
  | Search
  | Searchmenu
  | Nil
  | Home
  | Query
  | Htmx

let routes : route router =
  one_of
    [
      route (Routes.nil) Index;
      route (s "fonts" / str /? nil) (fun s -> Font s);
      route (s "style.css" /? nil) Stylesheet;
      route (s "min.js" /? nil) Js_bundle;
      route (s "favicon.ico" /? nil) Favicon;
      route (s "trees" / str /? nil) (fun s -> Tree s);
      route (s "search" /? nil) Search;
      route (s "searchmenu" /? nil) Searchmenu;
      route (s "nil" /? nil) Nil;
      route (s "home" /? nil) Home;
      route (s "query" /? nil) Query;
      route (s "htmx.js" /? nil) Htmx;
    ]
OCaml

Innovation. Community. Security.