예제 #1
0
        public IActionResult Post([FromBody] ShortUrl value)
        {
            try
            {
                var @new = _shortenerService.Generate(value.FullUrl);

                return(Created($"/shortener/{@new.Id}", @new));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }