Dotnet Core WebApi with HATEOAS, Versioning & Swagger, that contains Cake Build Scripts & Kubernetes Deployment ymls
The full stack .NET Core Web API project which contains
- Cross platform build scripts (Cake) - No additional installations needed
- Docker support
- Kubernetes yml files
- HATEOAS
- API Versioning
- Swagger UI
- A controller which is dealing with FoodItems. You can GET/POST/PUT/PATCH and DELETE them.
Nothing
mono == 5.8.0 libunwind8 == 1.1-4.1
- If you are using windows,
build.ps1
- If you are using linux,
./build.sh
- You can just take a look at
build.cake
to see whats going on.
docker build . # Create an image using artifacts
docker run -d -p 80:80 yourimageid # Provision & run the container
- OR Instant Run:
docker run -d -p 80:80 boranx/dotnetcorekubernetes
Browse : http://localhost/swagger/#/
kubectl apply -f kubernetes/aspnetcore-rest-api-pod.yaml # Deploy the pod
kubectl apply -f kubernetes/aspnetcore-rest-api-ks.yaml # Define services
http://localhost:80/swagger
http://localhost:80/api/v1/foods
http://localhost:80/api/v1/foods/2
http://localhost:80/api/v1/foods
{
"name": "Lasagne",
"type": "Main",
"calories": 3000,
"created": "2017-09-16T17:50:08.1510899+02:00"
}
http://localhost:80/api/v1/foods/5
{
"name": "Lasagne2",
"type": "Main",
"calories": 3000,
"created": "2017-09-16T17:50:08.1510899+02:00"
}
http://localhost:80/api/v1/foods/5
[
{ "op": "replace", "path": "/name", "value": "mynewname" }
]
http://localhost:80/api/v1/foods/5