Server Extensions

What Can Be Customized

The Origam server is implemented with C# Web API.

The server customization described here allows you to do two things:

  • add your own ASP .NET controllers
  • change server settings by modifying IApplicationBuilder (configured in Startup.cs). You can see what can be configured here

Custom Controller

First you have to create a new C# net6.0 library project and reference Microsoft.AspNetCore.Mvc package using NuGet. Then you can add the controller file. A minimal implementation could look like this:

using Microsoft.AspNetCore.Mvc;

namespace TestController;

public class CustomController : ControllerBase
    public IActionResult GetMessagesRequest()
        return Ok("Test");

This will result in a GET endpoint on route testPath/Custom/test/message which will return “Test”.
Then you can build the project and set the resulting *.dll path to the ExtensionDlls property in the appsettings.json. See Appsettings.json documentation for details.

Server Configuration

Create a new C# net6.0 library project and reference Origam.Service.Core package using NuGet. Then create a new class that will implement IWebApplicationExtender from the refeneced package. Implement the Extend method.

void Extend(IApplicationBuilder app, IConfiguration configuration)

Here you can call methods on the IApplicationBuilder. The IConfiguration parameter contains the server configuration from appsettings.json so you can read your own configuration from there.
Just like in the previous case you have to add path to your *.dll to the ExtensionDlls
property in the appsettings.json to load the dll into the server.


You can see examples of both custom controller and server configuration in the Origam.Chat project.