hello.ml 1.41 KB
Newer Older
zapashcanon's avatar
zapashcanon committed
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
let asset_loader _root path _request =
  match Assets.read path with
  | None -> assert false
  | Some asset -> Dream.respond asset

let () =
  Dream.run @@ Dream.logger
  @@ Dream.router
       [ Dream.get "/assets/**" (Dream.static ~loader:asset_loader "")
       ; Dream.get "/" (fun _request ->
             Dream.html
               (Template.render ~lang:"en"
                  ~title:"Harnessing Cutting-Edge Technologies" ~content:"Hi !" ) )
       ; Dream.get "/research-and-development" (fun _request ->
             Dream.html
               (Template.render ~lang:"en" ~title:"Research and Development"
                  ~content:"We research and we develop" ) )
       ; Dream.get "/expertise" (fun _request ->
             Dream.html
               (Template.render ~lang:"en" ~title:"Expertise"
                  ~content:"We are experts in expertise" ) )
       ; Dream.get "/trainings" (fun _request ->
             Dream.html
               (Template.render ~lang:"en" ~title:"Trainings"
                  ~content:"Do you know rust ?" ) )
       ; Dream.get "/team" (fun _request ->
             Dream.html
               (Template.render ~lang:"en" ~title:"Team"
                  ~content:"The team hihi" ) )
       ; Dream.get "/blog" (fun _request ->
             Dream.html
               (Template.render ~lang:"en" ~title:"Blog"
                  ~content:"This is an amazing blog !" ) )
       ]
  @@ Dream.not_found