Quickly clone this repository to get a .NET 7 minimal API which:
- Has a basic set of endpoints
- Produces OpenApi Explorer
- Has dependency injection usage examples ([FromServices])
- Demonstrates deprecated API (GetHostInfo2)
- Docker container support
- Has a basic Filter added (ExceptionFilter)
- devcontainer configured - only need container runtime, not dotnet locally installed (TODO)
- Has GitHub actions to build a container (TODO)
- Has a Client generator (TODO)
- Versioned API built-in (TODO)
- Has optional authentication/authorization with Azure AD (TODO)
cd BasicWebApi/
docker build -t dotnet-basic-webapi:latest .
docker run --rm -p 5080:80 dotnet-basic-webapi:latest
open http://localhost:5080/swagger/
zsh :
TEMPLATENAME="dotnet-basic-webapi"
NEWNAME="ClonedWebApi"
git clone https://github.com/mitch-b/dotnet-basic-webapi $NEWNAME
# update filenames
find "$NEWNAME" -type f -name "$TEMPLATENAME*" | sed "p;s/$TEMPLATENAME/$NEWNAME/g" | xargs -L2 echo mv
# update namespaces
sed -i -- 's/$TEMPLATENAMESPACE/$NEWNAMESPACE/g' **/*(D.)
PowerShell :
# TODO
Bash :
# TODO