Commit 8280ed44 by artur.rachwal

dashboard data works

parent eccf5894
using Microsoft.AspNetCore.Mvc;
namespace Pi.Hub.Api.Controllers
{
[Route("api/[controller]")]
public class DashboardController : Controller
{
public object Get()
{
string text = System.IO.File.ReadAllText("C:\\apps\\msgs.txt");
return $"{{\"data\":[{text}]}}";
}
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
namespace Pi.Hub.Api.Controllers
{
......@@ -20,6 +21,8 @@ namespace Pi.Hub.Api.Controllers
[Route("[action]")]
public object Echo([FromBody]object obj)
{
string serialized = JsonConvert.SerializeObject(obj);
System.IO.File.AppendAllLines("C:\\apps\\msgs.txt", new[] { ","+serialized });
return new
{
Echo = obj
......
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win-arm;linux-arm;x86</RuntimeIdentifiers>
<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment