X Tutup
Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit fe6caf8

Browse files
authored
Merge pull request #1 from morriq/streaming
Streaming
2 parents 1e85713 + b08e27a commit fe6caf8

File tree

9 files changed

+62667
-6
lines changed

9 files changed

+62667
-6
lines changed

samples/misc/NodeServicesExamples/Controllers/HomeController.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
using System;
12
using System.Threading.Tasks;
23
using Microsoft.AspNetCore.Mvc;
34
using Microsoft.AspNetCore.NodeServices;
45
using Microsoft.AspNetCore.SpaServices.Prerendering;
6+
using System.IO;
57

68
namespace NodeServicesExamples.Controllers
79
{
@@ -17,6 +19,18 @@ public IActionResult ES2015Transpilation()
1719
return View();
1820
}
1921

22+
public FileStreamResult Stream([FromServices] INodeServices nodeServices)
23+
{
24+
var d = nodeServices.InvokeAsync<Stream>("./addNumbers");
25+
var a = d.Result;
26+
27+
// byte[] bytes = new byte[10];
28+
29+
//a.ReadAsync(bytes, 0, 10);
30+
31+
return new FileStreamResult(a, "text/plain");
32+
}
33+
2034
public async Task<IActionResult> Chart([FromServices] INodeServices nodeServices)
2135
{
2236
var options = new { width = 400, height = 200, showArea = true, showPoint = true, fullWidth = true };

0 commit comments

Comments
 (0)
X Tutup