mirror of
https://github.com/fergalmoran/podnoms.git
synced 2026-02-08 08:45:54 +00:00
23 lines
659 B
C#
23 lines
659 B
C#
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using PodNoms.Api.Services.Processor;
|
|
|
|
namespace PodNoms.Api.Controllers {
|
|
[Route("[controller]")]
|
|
public class UtilityController : Controller {
|
|
private readonly IUrlProcessService _processor;
|
|
|
|
public UtilityController(IUrlProcessService processor) {
|
|
this._processor = processor;
|
|
|
|
}
|
|
[HttpGet("isvalid")]
|
|
public async Task<IActionResult> IsValid(string url) {
|
|
var result = await _processor.IsValidUrl(url);
|
|
if (result) {
|
|
return Ok();
|
|
}
|
|
return BadRequest();
|
|
}
|
|
}
|
|
} |