public async Task <IActionResult> CreateShortUrl([FromBody] UrlToShorten urlToShorten) { var shortUrl = await _urlShortenerService.CreateShortUrl(urlToShorten); if (shortUrl == null) { return(BadRequest()); } return(Ok(shortUrl)); }
public async Task <IActionResult> CreateShortUrl([FromBody] UrlToShorten urlToShorten) { var shortUrl = await _urlShortenerService.CreateShortUrl(urlToShorten); if (shortUrl == null) { return(BadRequest()); } return(Ok(shortUrl)); }