mirror of
https://github.com/CannedNet/CannedNet.git
synced 2026-10-25 23:18:54 -07:00
18 lines
360 B
C#
18 lines
360 B
C#
namespace CannedNet.Admin.Services;
|
|
|
|
public class ImageUrlService
|
|
{
|
|
private readonly string _baseUrl;
|
|
|
|
public ImageUrlService(string baseUrl)
|
|
{
|
|
_baseUrl = baseUrl.TrimEnd('/');
|
|
}
|
|
|
|
public string GetUrl(string? path)
|
|
{
|
|
if (string.IsNullOrEmpty(path)) return "";
|
|
return $"{_baseUrl}/{path.TrimStart('/')}";
|
|
}
|
|
}
|