Docs‎ > ‎REST APIs‎ > ‎

JavaScript Example

This procedure will download a JavaScript app that runs against the pre-installed Espresso Logic Demo project.  You can run the app directly from the file system - there's nothing to deploy.  Please follow the directions below.



Download the App

To get the application:
  1. Download the JavaScript sample app's zip file from here.

  2. Unzip it into a folder with no spaces in the path (important: do not run the files from the zip - that will not work).


Matching your Server Location and ApiKey


You'll need to update it to match your server location and APIKey, as described here.

First, a bit of background.  When you create your project (here called Espresso Logic demo as shown in "Current project"), Espresso Logic generates a default APIKey:


Using this, update the app as shown below:
  1. Open the WebContent/js/LogicDemo.js in a text editor, as shown below

  2. Update the ec2baseUrl, specifying your account / project.  Shown below are settings for account valJune18, using the pre-installed Espresso Logic demo project (its' urlName is obtained as described here).

  3. Update the currentApiKey from the setting above

Running the application

You can run this directly from the file system:
  1. Double-click WebContent/index.html - should run in your Browser.
This app should look as shown below.  Explore the various Use Cases, such as changing Line Items, adding Orders, etc.  To keep it simple, all changes are immediate - there is no save button.

When you make a change, you will see the transaction log (right side of screen, labelled Logic Execution Plan).  You can see the same log in your Logic Designer log screen, which you'll find useful for debugging your own applications.

ċ
EspressoLogicDemo.zip
(170k)
Val Huber,
Jun 19, 2013, 10:13 PM