JavaScript Sample Application

JavaScript Sample Application
lac31
The JavaScript sample application runs against the Demo database. You can run it directly from the file system.
For more information about the the Demo database, see Business Logic API Project Sample.
In this article:
 
 
Download the JavaScript Application
  1. Download the JavaScript sample application's  file. 
  2. Unzip it into a folder that does not include spaces in the path.
    Do not run the files from the zip.
  3. Modify the 
    {root folder}/WebContent/LogicDemo.js
     JavaScript file.
The JavaScript application is downloaded.
Match your Server Location and Authentication Token
Update the 
Demo
 API sample to match your server location and authentication token. When you create your API (in this example, 
Demo
), API Creator generates a default authentication token.
The following image shows the 
demo_full
 key in the 
Demo
 API sample:
  CA Technologies  
Follow these steps:
  1. Open the 
    WebContent/js/LogicDemo.js
     file 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.)
    For more information about the 
    urlName
    , see The API Project URL.
  3. Update the 
    currentApiKey
    . The following image shows the contents of the 
    LogicDemo.js
     file:
    CA Technologies  
  4. Save your changes.
The server location and authentication token are matched.
Run the Application
Run the application directly from the file system. Double-click 
WebContent/index.html
. The application runs in your browser.
The following image illustrates how the app should look:
 
 
Explore the various use cases, such as changing line items and adding orders. 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.