- Follow the tutorial: https://github.com/MLstate/opalang/wiki/Hello%2C-reCaptcha%2C-and-the-rest-of-the-world
- Read the source of the demo: https://github.com/MLstate/hello_recaptcha
Note: the demo uses the old bypass syntax, but you can use the new one with
opa --js-bypass-syntax jsdoc(we will release it in a future version). Example: https://github.com/MLstate/opalang/blob/master/lib/plugins/opabsl/jsbsl/bslClient.js
3 plugins:
- filepickerClientOnly.js // functions that works only on the cient side
- filepicker.js // functions that can be both on the server and the client side
- filepicker.nodejs // just a symlink to filepicker.js:
// having a .nodejs file is currently the only way to create a server-side js plugin.
// (to be improved later in Opa)
Then:
- filepicker.opa // calls Filepicker or FilepickerClientOnly plugins module
// the Opa Slicer will automatically compile for the client and server,
// and automate the calls between client and server (for example for the setKey function)
Compile:
$ opa filepickerClientOnly.js filepicker.js filepicker.nodejs filepicker.opa test.opa