Created
June 2, 2020 19:50
-
-
Save jsheridanwells/f46be63d2179b955fdc2ee67712bab53 to your computer and use it in GitHub Desktop.
weather-walking-skeleton-part_0
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
# bash | |
$ dotnet new webapi -o WeatherWalkingSkeleton |
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
# bash | |
├── Controllers | |
│ └── WeatherForecastController.cs | |
├── Program.cs | |
├── Properties | |
│ └── launchSettings.json | |
├── Startup.cs | |
├── WeatherForecast.cs | |
├── WeatherWalkingSkeleton.csproj | |
├── appsettings.Development.json | |
├── appsettings.json |
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
// Program.cs | |
public static void Main(string[] args) | |
{ | |
CreateHostBuilder(args).Build().Run(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureWebHostDefaults(webBuilder => | |
{ | |
webBuilder.UseStartup<Startup>(); | |
}); |
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
// WeatherForecastController.cs | |
[ApiController] | |
[Route("[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{ | |
// [...] | |
[HttpGet] | |
public IEnumerable<WeatherForecast> Get() | |
{ | |
// [...] | |
} | |
} |
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
info: Microsoft.Hosting.Lifetime[0] | |
Now listening on: https://localhost:5001 | |
info: Microsoft.Hosting.Lifetime[0] | |
Now listening on: http://localhost:5000 |
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
# bash | |
curl https://localhost:5001/WeatherForecast -k |
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
[ | |
{ | |
"date": "2020-05-26T13:06:20.464957-05:00", | |
"temperatureC": -9, | |
"temperatureF": 16, | |
"summary": "Warm" | |
}, | |
{ | |
"date": "2020-05-27T13:06:20.464998-05:00", | |
"temperatureC": -20, | |
"temperatureF": -3, | |
"summary": "Scorching" | |
}, | |
{ | |
"date": "2020-05-28T13:06:20.464999-05:00", | |
"temperatureC": 49, | |
"temperatureF": 120, | |
"summary": "Balmy" | |
}, | |
{ | |
"date": "2020-05-29T13:06:20.465-05:00", | |
"temperatureC": 9, | |
"temperatureF": 48, | |
"summary": "Mild" | |
}, | |
{ | |
"date": "2020-05-30T13:06:20.465-05:00", | |
"temperatureC": -9, | |
"temperatureF": 16, | |
"summary": "Freezing" | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment