Created
December 15, 2016 15:42
-
-
Save bluddy/c6642a7aef425b34fc1d0bba8f61f068 to your computer and use it in GitHub Desktop.
trying example eliom site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[%%shared | |
open Eliom_lib | |
open Eliom_content | |
open Html.D | |
] | |
module Mysite_app = | |
Eliom_registration.App ( | |
struct | |
let application_name = "mysite" | |
let global_data_path = None | |
end) | |
let f _ () = | |
Lwt.return "<html><head><title>Hello world</title></head><body>Welcome</body></html>" | |
let main_service = | |
Eliom_registration.Html_text.create | |
~path:(Eliom_service.Path ["aaa"; "bbb"]) | |
~meth:(Eliom_service.Get Eliom_parameter.any) | |
f | |
let () = | |
Mysite_app.register | |
~service:main_service | |
(fun _ () -> | |
Lwt.return | |
(Eliom_tools.F.html | |
~title:"mysite" | |
~css:[["css";"mysite.css"]] | |
Html.F.(body [ | |
h1 [pcdata "Welcome from Eliom's distillery!"]; | |
]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment