Work in progress
This is an example repo for setting up the BEE email editor plugin (https://beefree.io/) that uses Perl5 with a Dancer web framework and AngularJS.
-
Request a
client_idandclient_secretfrom https://beefree.io/ and add it toenvironments/bee.yml. Use https://auth.getbee.io/apiauth as thebase_url. -
The BEE plugin is delivered via CDN, so you must authorize your app with beefree via OAuth2. To receieve a token, make a
POSTrequest to https://auth.getbee.io/apiauth with the parameters:grant_type => passwordclient_id => $YOUR_CLEINT_IDclient_secret => $YOUR_CLIENT_SECRET
You will receive a JSON structure back as the token. In this example, the request is made on the server side for security reasons.
-
You will load the plugin into your HTML with this
srctag:<script src="https://app-rsrc.getbee.io/plugin/BeePlugin.js"></script>
Provide a
divwithid="bee-plugin-container"for the plugin to live in.Both of these elements are wrapped in another
div, which initializes the Angular controller:<div class="bee-plugin-main-container" ng-controller="BeePluginController" ng-init="initBeePlugin()"> <script src="https://app-rsrc.getbee.io/plugin/BeePlugin.js"></script> <div id="bee-plugin-container"></div> </div>
-
Lanch the web server with
plackup:
$ plackup bin/app.plWhich will bind to: http://0.0.0.0:5000
And that's it! More configuration features can be found on https://beefree.io/