add signalr support
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
using BinaryDad.Notes.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BinaryDad.Notes.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class ApiController : ControllerBase
|
||||
{
|
||||
private readonly INoteService noteService;
|
||||
|
||||
public ApiController(INoteService noteService)
|
||||
{
|
||||
this.noteService = noteService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("get")]
|
||||
public string Get() => noteService.Get();
|
||||
|
||||
[HttpPost]
|
||||
[Route("save")]
|
||||
public async Task<bool> Save()
|
||||
{
|
||||
var content = string.Empty;
|
||||
|
||||
using (var reader = new StreamReader(Request.Body))
|
||||
{
|
||||
content = await reader.ReadToEndAsync();
|
||||
}
|
||||
|
||||
noteService.Save(content);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user