Skip to content

Commit 82e8430

Browse files
author
Marcin Drobik
committed
Cleaning program.cs
1 parent 70b87f2 commit 82e8430

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

src/React.Sample.Owin/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public class Startup
3535
{
3636
public void Configuration(IAppBuilder app)
3737
{
38-
Initializer.Initialize(_ => _);
39-
4038
#if DEBUG
4139
app.UseErrorPage();
4240
#endif

src/React.Sample.Owin/Startup.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System;
2+
3+
using Microsoft.Owin.FileSystems;
4+
using Microsoft.Owin.StaticFiles;
5+
6+
using Owin;
7+
8+
using React.Owin;
9+
10+
namespace React.Sample.Owin
11+
{
12+
public class Startup
13+
{
14+
public void Configuration(IAppBuilder app)
15+
{
16+
#if DEBUG
17+
app.UseErrorPage();
18+
#endif
19+
20+
app.Use(
21+
async (context, next) =>
22+
{
23+
Console.WriteLine("{0} {1} {2}", context.Request.Method, context.Request.Path, context.Request.QueryString);
24+
25+
try
26+
{
27+
await next();
28+
}
29+
catch (Exception exception)
30+
{
31+
Console.WriteLine(exception.ToString());
32+
throw;
33+
}
34+
});
35+
36+
var contentFileSystem = new PhysicalFileSystem("Content");
37+
38+
app.UseJsxFiles(new JsxFileOptions() { StaticFileOptions = new StaticFileOptions() { FileSystem = contentFileSystem }});
39+
app.UseFileServer(new FileServerOptions() { FileSystem = contentFileSystem });
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)