This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IHostBuilder CreateHostBuilder(string[] args) { | |
var portString = (System.Environment.GetEnvironmentVariable("PORT")); | |
if (String.IsNullOrEmpty(portString)) { | |
portString = "3005"; | |
} | |
return Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => | |
{ | |
webBuilder.UseStartup<Startup>(); | |
webBuilder.UseUrls("http://localhost:" + portString + "/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Returns a list of sneakers | |
/// </summary> | |
/// <returns> A list of sneakers</returns> | |
/// <remarks> | |
/// | |
/// Sample request | |
/// GET /api/sneakers | |
/// | |
/// </remarks> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Configure Swashbuckle for XML comments in the file: | |
services.AddSwaggerGen(s => | |
{ | |
s.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo{ | |
Version = "V1", | |
Title = "Sneaker API", | |
Description = "API for retrieving documents" | |
}); | |
var xmlFile = $"{ | |
Assembly.GetExecutingAssembly().GetName().Name}.xml"; |