C#
Файл WeatherForecastController.cs
using Microsoft.AspNetCore.Mvc;
namespace WebApiCore.Controllers
{
[ApiController]
[Route("weather")]
public class WeatherForecastController : ControllerBase
{
[HttpGet]
public string Today()
{
return "22 degree";
}
[HttpGet("tomorrow")]
public string Tomorrow()
{
return "25 degree (hot)";
}
}
}
json
Файл launchSettings.json
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:61246",
"sslPort": 44374
}
},
"profiles": {
"WebApiCore": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "weather",
"applicationUrl": "https://localhost:7211;http://localhost:5082",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "weather",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}