Wiki

Clone wiki

limeds-framework / Getting Started - The Visual Editor

Tutorial: Getting Started - The Visual Editor

To get the hang of the visual side of the framework, we will create a Greeter HTTP service using the editor.

1) Go to the URL that hosts the editor at http://[host_ip]:[limeds_port]/editor

limeds_tutorial_1.jpg

2) Click the "New Slice" button to the right of your screen and fill in the requested fields.

limeds_tutorial_2.jpg

3) Double-click on the newly created Slice to edit it.

limeds_tutorial_3.jpg

4) Add a new Segment (a LimeDS component that performs some logical function and can connect with others), let's call it Greeter.

limeds_tutorial_4.jpg

5) Configure the Segment to be accessible as an HTTP service by right-clicking on the Segment and then selecting "Assign Entry Points".

limeds_tutorial_5.jpg

6) Enable the Web endpoint and fill in the Path to use, notice how we can configure a path parameter by using the {path variable} syntax. Click "Save" at the bottom of the dialog to return to the Slice flow.

limeds_tutorial_6.jpg

7) Double-click the Segment to open the code editor. Let's add a little snippet that returns a greeting message as a JSON object. The name of the person to greet will be supplied as the configured path parameter. The value of the parameter can be accessed by using the HttpContext object, which is supplied as a second parameter for the function.

limeds_tutorial_7.jpg

8) The Slice is now ready to be deployed. To do this, toggle the button which is now indicated as "Inactive (Red)" in order to save and deploy the flow. After a few seconds, the button should change to "Active (Green)" which indicates a successful deployment.

limeds_tutorial_8.jpg

9) Return to the main editor page and click on the Swagger UI button. This page will provide you with an overview of all the configured HTTP endpoints for the instance. After expanding the default tab, you should see the greeter API that we've just added.

limeds_tutorial_9.jpg

You can directly test your APIs here by filling in the parameters and clicking "Try it out!".

limeds_tutorial_10.jpg

Updated