Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
Reacting to new Hosting API
Browse files Browse the repository at this point in the history
  • Loading branch information
JunTaoLuo committed Dec 18, 2015
1 parent 1c0996c commit f49c218
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 24 deletions.
11 changes: 11 additions & 0 deletions samples/AntiforgerySample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using Microsoft.AspNet.Antiforgery;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Routing;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -69,5 +70,15 @@ public void Configure(IApplicationBuilder app, IAntiforgery antiforgery, IOption

app.UseRouter(routes.Build());
}

public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();

application.Run();
}
}
}
3 changes: 3 additions & 0 deletions samples/AntiforgerySample/hosting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}
49 changes: 25 additions & 24 deletions samples/AntiforgerySample/project.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"version": "1.0.0-*",

"dependencies": {
"Microsoft.AspNet.Antiforgery": "1.0.0-*",
"Microsoft.AspNet.Http.Abstractions": "1.0.0-rc2-16062",
"Microsoft.AspNet.Http.Abstractions": "1.0.0-*",
"Microsoft.AspNet.Http.Extensions": "1.0.0-*",
"Microsoft.AspNet.Routing.Extensions": "1.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Newtonsoft.Json": "7.0.1"
},

"commands": {
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000",
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"
},
"compilationOptions": {
"emitEntryPoint": true
},

"commands": {
"web": "AntiforgerySample"
},

"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},

"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
]
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
]
}
9 changes: 9 additions & 0 deletions samples/AntiforgerySample/wwwroot/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" forwardWindowsAuthToken="false" startupTimeLimit="3600" />
</system.webServer>
</configuration>

0 comments on commit f49c218

Please sign in to comment.