Skip to content

Commit 6da5660

Browse files
committed
Added simple HomeController
1 parent 96469cc commit 6da5660

File tree

4 files changed

+69
-11
lines changed

4 files changed

+69
-11
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
3+
namespace AbpCompanyName.AbpProjectName.Web.Controllers
4+
{
5+
public class HomeController : Controller
6+
{
7+
public IActionResult Index()
8+
{
9+
return View();
10+
}
11+
}
12+
}

AbpCompanyName.AbpProjectName/src/AbpCompanyName.AbpProjectName.Web/Startup.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
using Microsoft.AspNetCore.Builder;
6-
using Microsoft.AspNetCore.Hosting;
7-
using Microsoft.AspNetCore.Http;
1+
using Microsoft.AspNetCore.Builder;
82
using Microsoft.Extensions.DependencyInjection;
93

104
namespace AbpCompanyName.AbpProjectName.Web
@@ -15,14 +9,19 @@ public class Startup
159
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
1610
public void ConfigureServices(IServiceCollection services)
1711
{
12+
services.AddMvc();
1813
}
1914

2015
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
2116
public void Configure(IApplicationBuilder app)
2217
{
23-
app.Run(async (context) =>
18+
app.UseStaticFiles();
19+
20+
app.UseMvc(routes =>
2421
{
25-
await context.Response.WriteAsync("Hello World!");
22+
routes.MapRoute(
23+
name: "default",
24+
template: "{controller=Home}/{action=Index}/{id?}");
2625
});
2726
}
2827
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title></title>
6+
</head>
7+
<body>
8+
<p>HELLO WORLD from ASP.NET CORE!</p>
9+
</body>
10+
</html>

AbpCompanyName.AbpProjectName/src/AbpCompanyName.AbpProjectName.Web/project.json

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,54 @@
11
{
22
"dependencies": {
33
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
4-
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final"
4+
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
5+
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
6+
"Microsoft.AspNetCore.Razor.Tools": {
7+
"version": "1.0.0-preview1-final",
8+
"type": "build"
9+
},
10+
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
11+
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
12+
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
13+
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
14+
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
15+
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
16+
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
17+
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
18+
"version": "1.0.0-preview1-final",
19+
"type": "build"
20+
},
21+
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
22+
"version": "1.0.0-preview1-final",
23+
"type": "build"
24+
}
525
},
626

727
"tools": {
28+
"Microsoft.AspNetCore.Razor.Tools": {
29+
"version": "1.0.0-preview1-final",
30+
"imports": "portable-net45+win8+dnxcore50"
31+
},
832
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
933
"version": "1.0.0-preview1-final",
1034
"imports": "portable-net45+win8+dnxcore50"
35+
},
36+
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
37+
"version": "1.0.0-preview1-final",
38+
"imports": [
39+
"portable-net45+win8+dnxcore50",
40+
"portable-net45+win8"
41+
]
1142
}
1243
},
1344

1445
"frameworks": {
15-
"net452": { }
46+
"net452": {
47+
"Microsoft.NETCore.App": {
48+
"version": "1.0.0-rc2-3002702",
49+
"type": "platform"
50+
}
51+
}
1652
},
1753

1854
"buildOptions": {
@@ -23,6 +59,7 @@
2359
"publishOptions": {
2460
"include": [
2561
"wwwroot",
62+
"Views",
2663
"web.config"
2764
]
2865
},

0 commit comments

Comments
 (0)