Templates

Templates

Templates allow to create new projects based on the GenHTTP SDK (such as webservices or websites) in a couple of minutes. To install the project templates in your environment run the following command in your terminal:

dotnet new -i GenHTTP.Templates
    

After the templates have been installed, new projects can be created using the following commands:

mkdir AppName
    cd AppName
    dotnet new <template-name>
    

If installed, the templates will also show up in Visual Studio and can be used from there to quickly create new projects:

GenHTTP template projects in Visual Studio

The following templates are available to be used:

Template Description
genhttp-webservice A project that will host a new REST web service.
genhttp-webservice-minimal A project that will host a minimal web service in a single file using the functional module.
genhttp-website A website, mainly for static content (such as a business website).
genhttp-website-mvc-razor Dynamic website using the MVC pattern and Razor as a templating engine.
genhttp-website-mvc-scriban Dynamic website using the MVC pattern and Scriban as a templating engine.
genhttp-website-static Serves a static website from the file system.

Updating Templates

To update your locally installed project templates, run the following command in your terminal:

dotnet new update