Startup Extensions
Startup Extensions structured way to register services, manage middleware, and handle application startup configurations, dependency injections, app settings. These extensions help register custom libraries, handle HTTP requests/responses, and execute startup configurations in an organized manner.
Middlewares
Middleware is a pipeline component that processes HTTP requests and responses. It is used for:
- Authentication & Authorization
- Logging & Monitoring
- Error Handling
- Routing & Redirection
How Middleware Works
Middleware follows a request-response pipeline, where each component:
- Processes the request before passing it to the next component.
- Processes the response before sending it to the client.
- Short-circuits the pipeline (stops further execution if needed).
Create a Middleware
Step 1: Add Middleware
- Right-click Middlewares in the Startup Extension and select Add.
- Configure the required properties in the Properties Panel.
Step 2: Configure Middleware Properties
| Property | Description | Comments |
|---|---|---|
| Name* | Unique name for the middleware. | No spaces or special characters (except _). |
| Order | Execution order in the pipeline. | Middleware runs sequentially. |
| Description | Summary of the middleware. | Optional. |
| Is Active | Enables or disables middleware. | Default is Yes. |
Step 3: Design Middleware Logic
- The Middleware Designer Canvas appears with default Start & Stop constructs.
- From the ribbon, drag and drop necessary constructs (e.g., If, Log, Initialize).
- Configure the constructs to define the logic.
Step 4: Save and Deploy Middleware
- Click Save to confirm changes.
- A "Middleware added successfully" message appears.
Structure of Middleware
Middleware consists of variables for managing request and response data.
Adding Variables to Middleware
- Right-click Variables and select Add.
- Configure the following Parameter Properties. A success message appears upon successfully adding variables.
| Property | Description | Comments |
|---|---|---|
| Parameter Name* | Name of the variable. | No spaces or special characters (except _). |
| Is Array | Specifies if the variable is an array. | Default is No. |
| Data Type* | Select the data type. | Mandatory. |
Constructs Available in Middleware
Middleware logic can use the following constructs:
- Logic Constructs: If, Switch, While, Foreach, Continue, Return
- Initialization & Logging: Initialize, Log
- Code Execution: C# Snippet
- Middleware-Specific Constructs: Middleware, Add JSON to Configuration
Services
A Startup Extension Services is used to configure services, dependency injection, and application startup behaviour.
Step 1: Add a Startup Extension
- Right-click Services in the Startup Extension section.
- Select Add and configure properties.
Step 2: Configure Startup Extension Properties
| Property | Description | Comments |
|---|---|---|
| Name* | Unique name for the startup extension. | No spaces or special characters (except _). |
| Order | Defines execution order. | Services execute in sequence. |
| Description | Summary of the startup extension. | Optional. |
| Is Active | Enables or disables the service. | Default is Yes. |
Step 3: Design Startup Extension Logic
- The Startup Extension Designer Canvas appears with Start & Stop constructs.
- Drag and drop constructs from the ribbon to configure the flow.
- Define dependency injection, service registration, and configurations.
Step 4: Save and Deploy the Extension
- Click Save to finalize changes.
- A "Startup Extension added successfully" message appears.
Structure of a Service
Startup Extensions contain variables used for service configuration.
Adding Variables to a Startup Extension
- Right-click Variables and select Add.
- Configure Parameter Properties as required.
| Property | Description | Comments |
|---|---|---|
| Parameter Name* | Name of the variable. | No spaces or special characters (except _). |
| Is Array | Specifies if the variable is an array. | Default is No. |
| Data Type* | Select the data type. | Mandatory. |
Available Constructs
Startup Extensions use the following constructs:
- Logic Constructs: If, Switch, While, Foreach, Continue, Return
- Initialization & Logging: Initialize, Log
- Code Execution: C# Snippet, Call Library Function
- Service Configuration: Register Service, Add JSON to Configuration