Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pi.hub
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
iot
pi.hub
Commits
8280ed44
Commit
8280ed44
authored
Jun 16, 2017
by
artur.rachwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard data works
parent
eccf5894
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletions
+20
-1
Pi.Hub.Api/Controllers/DashboardController.cs
+15
-0
Pi.Hub.Api/Controllers/StatusController.cs
+3
-0
Pi.Hub.Api/Pi.Hub.Api.csproj
+2
-1
No files found.
Pi.Hub.Api/Controllers/DashboardController.cs
0 → 100644
View file @
8280ed44
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
Pi.Hub.Api/Controllers/StatusController.cs
View file @
8280ed44
...
...
@@ -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
...
...
Pi.Hub.Api/Pi.Hub.Api.csproj
View file @
8280ed44
<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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment