A sample accelerator for C#.
This sample is the Weather Forecast RESTful API application made available from Microsoft. It provides a single endpoint, /weatherforecast
, that returns a mock forecast for the upcoming several days.
The starting source for this sample was created using:
$ dotnet new webapi --language C#
To run the sample application:
$ dotnet run
URL | Description |
---|---|
http://localhost:5000/swagger | API Documentation |
http://localhost:5000/weatherforecast | Weather Forecast Endpoint |
NOTE: The provided
config/workload.yaml
file uses the Git URL for this sample. When you want to modify the source, you must push the code to your own Git repository and then update thespec.source.git
information in theconfig/workload.yaml
file.
If you make modifications to the source, push these changes to your own Git repository.
When you are done developing your app, you can simply deploy it using:
tanzu apps workload apply -f config/workload.yaml
If you would like deploy the code from your local working directory you can use the following command:
tanzu apps workload create sample-app -f config/workload.yaml \
--local-path . \
--source-image <REPOSITORY-PREFIX>/sample-app-source \
--type web
Determine the URL to use for the accessing the app by running:
tanzu apps workload get sample-app
To access the deployed app use the URL shown under "Workload Knative Services" and append the endpoint /weatherforecast
to that URL.
This depends on the TAP installation having DNS configured for the Knative ingress.