An open API service indexing awesome lists of open source software.

https://github.com/liteobject/template.api.with.db


https://github.com/liteobject/template.api.with.db

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          






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 `

## 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 `

## How can I uninstall this _My Basic API Template_ template?
* Run one of the following commands:
* `dotnet new uninstall ` // 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:

```json
{
"$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:
* [dotnet new list](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new-list)
* [Custom templates for dotnet new](https://learn.microsoft.com/en-us/dotnet/core/tools/custom-templates)
* [Properties of template.json](https://learn.microsoft.com/en-us/dotnet/core/tools/custom-templates#templatejson)
* [File matching patterns reference](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/file-matching-patterns?view=azure-devops#match-characters)