summaryrefslogtreecommitdiff
path: root/bs5/server/pages/Index.re
blob: d5af8228fee8a138fba06b7553cd608b7354b94e (plain)
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
39
40
module Page = {
  [@react.async.component]
  let make = () => {
    // let promiseIn2 =
    //   Lwt.bind(Lwt_unix.sleep(2.0), _ =>
    //     Lwt.return("Solusionao in 2 seconds!")
    //   );
    // let promiseIn4 =
    //   Lwt.bind(Lwt_unix.sleep(4.0), _ =>
    //     Lwt.return("Solusionao in 4 seconds!")
    //   );
    Lwt.return(
      <div> {React.string("Well hi")} </div>,
    );
  };
};

module App = {
  [@react.component]
  let make = () => {
    <html>
      <head>
        <meta charSet="utf-8" />
        <link rel="stylesheet" href="/output.css" />
      </head>
      <body>
        <div id="root">
          // <DemoLayout background=Theme.Color.Gray2> <Page /> </DemoLayout>
           <div> <Page /> </div> </div>
      </body>
    </html>;
  };
};

let handler = request =>
  Rsc.DreamRSC.create_from_request(
    ~bootstrap_modules=["/static/demo/SinglePageRSC.re.js"],
    <App />,
    request,
  );