Hosting with the C# Client Library

When the Directscale Middleware is added to an ASP.NET Core web app project 4 endpoints are added to help with the operations of Hosting A Client Web Application.


Middleware Endpoints


/hooks/GetRoutes

HTTP Verb: Get

This will return a JSON body of all the endpoints that are configured in the setup options configured in the Directscale middleware.


/api/extension/services/RegistrationService/RemoveDeletedRegistrations

HTTP Verb: Post

👍

This endpoint should be called during the process of deploying a new version. Call this endpoint on a new version of code before traffic is sent to the new version. This avoids errors by making sure any endpoints that no longer exist are not configured to be called.


/api/extension/services/RegistrationService/UpdateAllRegistrations

HTTP Verb: Post

  • This adds or updates configurations in Corp Admin that are new or updated configurations in the middleware.
  • This endpoint is secured. See Authorizing Client Web Application APIs for more information.

👍

This endpoint should be called during the process of deploying a new version. Call this endpoint on a new version of code after traffic is sent to the new version. This avoids errors by making sure any endpoints that did not exist until the new version was deployed were not configured to be called until it was deployed.

❗️

The endpoint UpdatesAllRegistrations by removing all configurations and registering only the endpoints configured in the Directscale middleware. Any manual changes to configurations will be reversed unless the configuration of the Directscale middleware is updated.


/api/extension/version

HTTP Verb: Get

Returns the current version of the Extension

👍

This endpoint returns the Assembly Version of the ASP.NET Core web application. See how to set the Assembly Version with the AssemblyVersionAttribute Class


Auto-Configuration


Using the endpoints listed above makes updating the configurations in Corp Admin during a deployment easy. It can even be scripted as part of a deployment process.

👍

Using the Client Extension?

The Client Extension uses the /api/extension/services/RegistrationService/RemoveDeletedRegistrations and /api/extension/services/RegistrationService/UpdateAllRegistrations endpoints to automatically update configurations during a deployment. Learn more about Deploying The Client Extension