JavaScript Sample Application

The JavaScript sample application runs against the Business Logic API project sample database. You can run it directly from the file system.

For more information about the Demo API project database, see Business Logic API Project Sample.

Download the JavaScript Application

  1. Download the JavaScript sample application's file. 
  2. Unzip it into a folder with no spaces in the path.
    Important! Do not run the files from the zip.
  3. Modify the {froot folder}/WebContent/LogicDemo.js JavaScript file.
The JavaScript application is downloaded.

Match your Server Location and Auth Token

Update the Demo project to match your server location and auth token. When you create your API project (in this example, Demoas shown in "Current project"), API Creator generates a default auth token. The following image shows the Manage, Auth Tokens, Key tab:
  1. Open the WebContent/js/LogicDemo.js in a text editor.
  2. Update the ec2baseUrl, specifying your account / project. The following example shows the settings for account valJune18, using the pre-installed demo project (Its urlName is obtained as described here).
  3. Update the currentApiKey:

Run the Application

Run the application directly from the file system. Double-click WebContent/index.htmlThe application runs in your browser.

The following image illustrates how the app should look:

Explore the various use cases, such as changing Line Items, adding Orders, etc. Changes are immediate; you do not have to save. Changes are detailed as transaction logs in the Logic Execution Plan pane. The same log displays in your log screen.

For more information about logs and the log screen, including how to debug applications, see View Logging Information.