Edit on GitHub

Website Templates

There are 3 templates for each of the different technologies that can be used with ServiceStack to develop Server HTML Generated Websites and HTTP APIs which can be installed with dotnet-new:

$ npm install -g @servicestack/cli

$ dotnet-new mvc AcmeMvc

Which will create a new .NET Core 2.0 MVC Project called AcmeMvc. The Template Names, Source Code and Live Demos for each Website Template is available below:

.NET Core 2.0 .NET Framework Single Page App Templates
mvc mvc-netfx MVC Bootstrap Template
The mvc template differentiates the most between .NET Core and ASP.NET versions as ASP.NET Core MVC and ASP.NET MVC 5 are completely different implementations. With mvc ServiceStack is configured within the same .NET Core pipeline and shares the same request pipeline and “route namespace” but in ASP.NET MVC 5, ServiceStack is hosted at the /api Custom Path. Use MVC if you prefer to create different Controllers and View Models for your Website UI independently from your HTTP APIs or if you prefer to generate server HTML validation errors within MVC Controllers.

mvc.web-templates.io

razor razor-netfx ServiceStack.Razor Bootstrap Template
The razor Template is configured to develop Websites using ServiceStack.Razor for developing server-generated Websites using Razor without MVC Controllers which lets you create Content Razor Pages that can be called directly or View Pages for generating HTML Views for existing Services. The source code for .NET Core and ASP.NET Framework projects are nearly identical despite being completely different implementations with the .NET Core version being retrofitted on top of .NET Core MVC Views. Use razor templates if you like Razor and prefer the API First Development model or plan on developing Websites for both .NET Core and ASP.NET and would like to be easily able to migrate between them.

razor.web-templates.io

templates templates-netfx ServiceStack Templates Bootstrap Template
The templates Project Template is configured to develop Websites using ServiceStack Templates, a simpler and cleaner alternative to Razor that lets you utilize simple Template Expressions for evaluating Server logic in .html pages. Templates doesn’t require any precompilation, is easier to learn and more intuitive for non-programmers that’s more suitable for a number of use-cases. Use templates if you want an alternative to Razor syntax and the heavy machinery required to support it.

templates.web-templates.io

Hot Reloading

Both razor and templates project enjoy Hot Reloading where in development a long poll is used to detect and reload changes in the current Template Page or static files in /wwwroot.

Watched .NET Core builds

.NET Core projects can also benefit from Live Coding using dotnet watch which performs a “watched build” where it automatically stops, recompiles and restarts your .NET Core App when it detects source file changes. You can start a watched build from the command-line with:

$ dotnet watch run

.NET Core 2.0 ServiceStack WebApp Template

The .NET Core 2.0 templates-webapp project template is a pre-built .NET Core 2.0 App that dramatically simplifies .NET Wep App development by enabling Websites and APIs to be developed instantly without compilation.

.NET Core 2.0 ServiceStack Templates WebApp
templates-webapp

templates-webapp.web-templates.io

See templates.servicestack.net/docs/web-apps to learn the different use-cases made possible with Web Apps.