-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Echo.Api - ASP.NET Core 6.0 Server | ||
|
||
A simple API to store and retrieve messages. | ||
|
||
## Upgrade NuGet Packages | ||
|
||
NuGet packages get frequently updated. | ||
|
||
To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. | ||
|
||
|
||
Install dotnet-outdated tool: | ||
|
||
``` | ||
dotnet tool install --global dotnet-outdated-tool | ||
``` | ||
|
||
Upgrade only to new minor versions of packages | ||
|
||
``` | ||
dotnet outdated --upgrade --version-lock Major | ||
``` | ||
|
||
Upgrade to all new versions of packages (more likely to include breaking API changes) | ||
|
||
``` | ||
dotnet outdated --upgrade | ||
``` | ||
|
||
|
||
## Run | ||
|
||
Linux/OS X: | ||
|
||
``` | ||
sh build.sh | ||
``` | ||
|
||
Windows: | ||
|
||
``` | ||
build.bat | ||
``` | ||
## Run in Docker | ||
|
||
``` | ||
cd src/Echo.Api | ||
docker build -t echo.api . | ||
docker run -p 5000:8080 echo.api | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
:: Generated by: https://openapi-generator.tech | ||
:: | ||
|
||
@echo off | ||
|
||
dotnet restore src\Echo.Api | ||
dotnet build src\Echo.Api | ||
echo Now, run the following to start the project: dotnet run -p src\Echo.Api\Echo.Api.csproj --launch-profile web. | ||
echo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Generated by: https://openapi-generator.tech | ||
# | ||
|
||
dotnet restore src/Echo.Api/ && \ | ||
dotnet build src/Echo.Api/ && \ | ||
echo "Now, run the following to start the project: dotnet run -p src/Echo.Api/Echo.Api.csproj --launch-profile web" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
out="${1}" | ||
|
||
# https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/aspnetcore.md | ||
# docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli help config-help | ||
# docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli config-help -g aspnetcore | ||
|
||
spec=openapi.yaml | ||
image=openapitools/openapi-generator-cli | ||
docker pull -q "$image" | ||
|
||
docker run --rm -e CSHARP_POST_PROCESS_FILE=${CSHARP_POST_PROCESS_FILE} -v "${PWD}:/local" openapitools/openapi-generator-cli generate \ | ||
--skip-validate-spec \ | ||
--enable-post-process-file \ | ||
-c /local/config.yaml \ | ||
-i /local/echo.yaml \ | ||
-i /local/"$spec" \ | ||
-g aspnetcore \ | ||
-o /local/"$out" | ||
|
||
dos2unix $(find . -type f -exec grep -I -q . {} \; -print) | ||
pre-commit run -a |