Browse Source

Merge branch 'main' into feature/dashboard-enhancements

pull/1566/head
Razvan Goga 4 years ago
parent
commit
3cc4ad5391
  1. 20
      docs/tutorials/hello-tye/00_run_locally.md
  2. 4
      samples/mongo-sample/tye.yaml

20
docs/tutorials/hello-tye/00_run_locally.md

@ -92,9 +92,7 @@ Now that we have two applications running, let's make them communicate. By defau
3. Add a file `WeatherClient.cs` to the `frontend` project with the following contents:
```C#
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
namespace frontend
{
@ -129,20 +127,18 @@ Now that we have two applications running, let's make them communicate. By defau
dotnet add frontend/frontend.csproj package Microsoft.Tye.Extensions.Configuration --version "0.4.0-*"
```
5. Now register this client in `frontend` by adding the following to the existing `ConfigureServices` method to the existing `Startup.cs` file:
5. Now register this client in `frontend` by adding the following to the existing code in the `Program.cs` file:
```C#
...
public void ConfigureServices(IServiceCollection services)
services.AddRazorPages();
/** Add the following to wire the client to the backend **/
services.AddHttpClient<WeatherClient>(client =>
{
services.AddRazorPages();
/** Add the following to wire the client to the backend **/
services.AddHttpClient<WeatherClient>(client =>
{
client.BaseAddress = Configuration.GetServiceUri("backend");
});
/** End added code **/
}
client.BaseAddress = builder.Configuration.GetServiceUri("backend");
});
/** End added code **/
...
```

4
samples/mongo-sample/tye.yaml

@ -3,9 +3,9 @@ services:
- name: mongo
image: mongo
env:
- name: ME_CONFIG_MONGODB_ADMINUSERNAME
- name: MONGO_INITDB_ROOT_USERNAME
value: root
- name: ME_CONFIG_MONGODB_ADMINPASSWORD
- name: MONGO_INITDB_ROOT_PASSWORD
value: example
bindings:
- port: 27017

Loading…
Cancel
Save