I am playing with Ocsigen at the moment familiarising myself with the architecture and practices of using this web framework. A web-site is smoothly generated with ocsigen-start 2.16.1 in OCaml 4.10.0. Unfortunately, I got stuck with a very basic change I did on this fresh web-site, and at the moment I run out of ideas and knowledge.
ocsigen-start has so called “main_service” created in “os_services.eliom”, (actually, its compiled library installed by opam, but in this post I’ll be referring to the source code)
let%server main_service = Eliom_service.create ~path:(Eliom_service.Path ) ~meth:(Eliom_service.Get Eliom_parameter.unit) ()
and using the original names of template.distillery, registered in “PROJECT_NAME.eliom” that after the site generation is located in the fresh site’s folder, I creatively named my site “myapp” thus the file is called “myapp.eliom”
According to my shake knowledge of Eliom, this service is responsible for the home page (e.g. localhost:8080/). I did not like the idea of having one of the pages generated by a pre-installed OCaml library, thus
- I copied “Os_serivces.main_service” from “os_services.eliom” to “myapp_services.eliom”
- with the related Myapp_services.eliomi" change and
- replacing “Os_serivces.main_service” to “Myapp_serivces.main_service” in the rest of Myapp files
- (basically, I searched for “main_service” and pedantically replaced all I could find). For example, “myapp_service.eliom” now contains
Unfortunately, “make test.byte” command now returns the following error
ocsigenserver: ocsigen:main: Eliom: in site / - One service or coservice has not been registered on URL /.
ocsigenserver: ocsigen:main: Please correct your modules and make sure you have linked in all the modules…
make: *** [Makefile.os:87: test.byte] Error 20
the previously working site fails to runs, and after several attempts, I failed to understand why this is happening.
Do you have any ideas or better knowledge on how to make the site to behave?