Skip to content

Commit daef740

Browse files
Add Swagger UI
1 parent ea01473 commit daef740

File tree

4 files changed

+7
-154
lines changed

4 files changed

+7
-154
lines changed

src/SwiftLink.Presentation/Controllers/LinkController.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ namespace SwiftLink.Presentation.Controllers;
99
[Route("api/v{v:apiVersion}/[controller]/[action]")]
1010
public class LinkController(ISender sender) : BaseController(sender)
1111
{
12-
[HttpPost]
13-
public async Task<IActionResult> NewShorten([FromBody] GenerateShortCodeCommand command, CancellationToken cancellationToken = default)
14-
=> OK(await _mediarR.Send(command, cancellationToken));
15-
1612
[HttpPost]
1713
public async Task<IActionResult> Shorten([FromBody] GenerateShortCodeCommand command, CancellationToken cancellationToken = default)
1814
=> OK(await _mediarR.Send(command, cancellationToken));

src/SwiftLink.Presentation/Program.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@
5757
Title = "SwiftLink",
5858
Version = "v1",
5959
});
60-
c.SwaggerGeneratorOptions.Servers =
61-
[
62-
new() { Url = "http://localhost:56453" }
63-
];
6460
});
6561
}
6662

@@ -85,5 +81,12 @@
8581
options.AddCustomLabel("Host_IP", context => context.Request.Host.Host);
8682
});
8783

84+
app.UseSwagger();
85+
app.UseSwaggerUI(options =>
86+
{
87+
options.SwaggerEndpoint("/swagger/v1/swagger.json", "SwiftLink API v1");
88+
options.RoutePrefix = string.Empty;
89+
});
90+
8891
app.Run();
8992
}

src/SwiftLink.Presentation/wwwroot/swagger/swiftLink-api.yaml

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/SwiftLink.Presentation/wwwroot/swagger/v1.1/swagger.yaml

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)