mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 09:59:13 -05:00
31 lines
746 B
C#
31 lines
746 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class ValuesController : ControllerBase
|
|
{
|
|
[HttpGet]
|
|
public ActionResult<IEnumerable<string>> Get()
|
|
{
|
|
return new[] { "value1", "value2" };
|
|
}
|
|
|
|
[HttpGet("{id}")]
|
|
public ActionResult<string> Get(int id)
|
|
{
|
|
return "value";
|
|
}
|
|
|
|
[HttpPost]
|
|
public void Post([FromBody] string value) { }
|
|
|
|
[HttpPut("{id}")]
|
|
public void Put(int id, [FromBody] string value) { }
|
|
|
|
[HttpDelete("{id}")]
|
|
public void Delete(int id) { }
|
|
}
|
|
} |