Skip to content

LiteObject/Template.Api.With.Db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API with Database Template

This is a very basic API (with database) template only with one health check endpoint. This solution can be run directly or used to install the template. In order to make this repo more maintainable, no complex template syntaxes are used. All template related configurations are in the .template.config folder.

There are two main objectives of this initiative:

  • Quick creation and deployment of API
  • Keep the repo easy to understand (without complex templating code) so that it's maintainable

How can I use this repo to install the basic template?

  • Pull this repo
  • Run the following command:
    • dotnet new install .

How can I create a solution using the new basic API template?

  • Run one of the following commands:
    • dotnet new my-basic-api // from within the desired destinition folder
    • dotnet new my-basic-api -o <SOLUTION_NAME>

How can I view all the installed templates?

  • Run the following command:
    • dotnet new list

How can I search templates?

  • This can be done in different ways. Here are some examples:
    • dotnet new list --tag inspirato
    • dotnet new list --author LiteObjects
    • dotnet new list liteObject
    • dotnet new list <SEARCH_KEY_WORD>

How can I uninstall this My Basic API Template template?

  • Run one of the following commands:
    • dotnet new uninstall <PATH_TO_TEMPLATE_CONFIG_FOLDER> // if you need to explicitly specify the path of the ".template.config" folder
    • dotnet new uninstall . // if you are at the solution file level

Explanation of the template.json file:

{
    "$schema": "http://json.schemastore.org/template",
    "author": "LiteObjects Devs",
    // Used as search keyword -> $dotnet new list insp
    "classifications": [
        "liteObject", "webapi", "basic", "simple"  
    ],
    // A unique name for this template.
    "identity": "BasicTemplate.Api",
    "name": "My Basic API Template",
    // shortName will be used with dotnet new command to create 
    "shortName": "my-basic-api", 
    // sourceName will be replaced everywhere in the solution
    "sourceName": "BasicTemplate.Api",
    "preferNameDirectory": true,
    "tags": {
        "language": "C#",
        "type": "solution"
    }
}

Useful Links:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages