Skip to content

Instantly share code, notes, and snippets.

@nickytoh
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickytoh/a809195cd40b4cd2fd51 to your computer and use it in GitHub Desktop.
Save nickytoh/a809195cd40b4cd2fd51 to your computer and use it in GitHub Desktop.
Super minimal ASP.NET 5 MVC WebApi Project Template!
{
"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"
}
}
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();
}
}
}
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