add signalr support

This commit is contained in:
2023-01-25 08:48:50 -05:00
parent 1ee15a8ed3
commit 5a015b379b
9 changed files with 89 additions and 61 deletions

View File

@ -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;
}
}