Skip to content

Configuring Routes

Martini Webpage Template Routes

In Martini, linking a Web Page template to a specific path is efficiently achieved by configuring a route. This can be done within the Web Page template editor, particularly through the Route tab in the Properties view.

Accessing Your Template

Once a route is configured, the template becomes accessible under the base path /app. For instance, if you assign the route /todo to a template, it can be accessed at http://{host}:{port}/app/todo.

Configuration Steps

  1. Open the Web Page Template: Begin by opening the template you wish to expose.

  2. Access Properties View: Click the table icon in the toolbar to display the Properties view, typically situated on the right side of your screen.

  3. Navigate to the Route Tab: In the Properties view, select the Route tab.

  4. Select HTTP Method(s): Choose the appropriate HTTP method(s) for your web content. Commonly, GET is used for data requests, while POST is utilized for submitting data, such as in forms.

  5. Set Request Body (For POST Method): If POST is selected, specify the request body. This can be any of the template's inputs, chosen via the Body Parameter dropdown.

  6. Define the URL Path: Specify the URL path where your web content will be accessible. Path parameters can be included by enclosing them in braces {}. Martini will automatically map these to any Gloop template input property with the same name, excluding properties that are models or objects.

  7. Save Changes: Apply the changes by pressing Ctrl+S (or Cmd+S on macOS). The route will be active shortly after your instance registers the template's route, which usually takes a few seconds.