Skip to content

connoryates/bee_plugin

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
lib
 
 
 
 
 
 
 
 

bee_plugin

Perl and AngularJS example

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.

Overview

  • Request a client_id and client_secret from https://beefree.io/ and add it to environments/bee.yml. Use https://auth.getbee.io/apiauth as the base_url.

  • The BEE plugin is delivered via CDN, so you must authorize your app with beefree via OAuth2. To receieve a token, make a POST request to https://auth.getbee.io/apiauth with the parameters:

    • grant_type => password
    • client_id => $YOUR_CLEINT_ID
    • client_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 src tag:

       <script src="https://app-rsrc.getbee.io/plugin/BeePlugin.js"></script>

    Provide a div with id="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.pl

Which will bind to: http://0.0.0.0:5000

And that's it! More configuration features can be found on https://beefree.io/

About

Perl and AngularJS example (not Perl6 github, come on)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages