Table of Contents

Class UrlService

Namespace
Ando.Server.Services
Assembly
Ando.Server.dll

Default implementation of IUrlService.

public class UrlService : IUrlService
Inheritance
UrlService
Implements
Inherited Members

Constructors

UrlService(IOptions<ServerSettings>, IWebHostEnvironment)

public UrlService(IOptions<ServerSettings> serverSettings, IWebHostEnvironment environment)

Parameters

serverSettings IOptions<ServerSettings>
environment IWebHostEnvironment

Methods

BuildUrl(string, HttpContext?)

Builds a full URL from a relative path.

public string BuildUrl(string relativePath, HttpContext? httpContext = null)

Parameters

relativePath string

The relative path (e.g., "/auth/verify-email").

httpContext HttpContext

Optional HTTP context for development fallback.

Returns

string

The full URL.

GetBaseUrl(HttpContext?)

Gets the base URL for the application (e.g., "https://ci.example.com").

public string GetBaseUrl(HttpContext? httpContext = null)

Parameters

httpContext HttpContext

Optional HTTP context for development fallback.

Returns

string

The base URL without trailing slash.