The data variable will only exist on the server and be retrieved by the client via AJAX on load. It works by compiling it down to separate files, one for each end, and automatically setting up routes for the transition between contexts.
$ haplo main.js
$ npm install --global haplo
$ npm install haplo
// app/main.jsvar haplo = ;console;haplo;
<!-- app/public/index.html --><!-- bundle.js will be generated by the haplo command -->
Your application is now live at http://localhost:3000.
Fire it up and have a look at the browser's console as well the terminal window where haplo is running. You should see that the console messages are printed in their respective environments.
A simple example app with a MongoDB backend. Input is validated both on the client and server.
// app/main.jsvar haplo = ;var form = documentforms0;form;
<!-- app/public/index.html -->Haplo ExampleAdd item