示例#1
0
        public async Task <ActionResult <string> > ShorterLink([FromForm] string sourceLink)
        {
            if (sourceLink == null)
            {
                return(BadRequest());
            }

            var shortLink = await _linkService.CreateShortenerAsync(sourceLink, $"{this.Request.Scheme}://{this.Request.Host}");

            return(shortLink);
        }