Last active
August 29, 2015 14:27
-
-
Save nickytoh/a809195cd40b4cd2fd51 to your computer and use it in GitHub Desktop.
Super minimal ASP.NET 5 MVC WebApi Project Template!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"webroot": "wwwroot", | |
"dependencies": { | |
"Microsoft.AspNet.Mvc": "6.0.0-beta6", | |
"Microsoft.AspNet.Hosting": "1.0.0-beta6", | |
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta6", | |
"Microsoft.AspNet.StaticFiles": "1.0.0-beta6" | |
}, | |
"commands": { | |
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNet.Builder; | |
using Microsoft.Framework.DependencyInjection; | |
namespace WebApi | |
{ | |
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc(); | |
} | |
public void Configure(IApplicationBuilder app) | |
{ | |
app.UseStaticFiles(); | |
app.UseMvc(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNet.Mvc; | |
namespace WebApi | |
{ | |
[Route("api/[controller]")] | |
public class UserController: Controller | |
{ | |
[HttpGet] | |
public string Get() | |
{ | |
return "From /api/user"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment