@@ -97,18 +97,18 @@ app.Run();
9797
9898 Register multiple frontends directly in code using ` AddFrontends ` :
9999
100- ``` csharp
101- // Program.cs
102- builder . Services . AddBff ()
103- . AddFrontends (
104- new BffFrontend ( BffFrontendName . Parse ( " default-frontend " ))
105- . WithIndexHtmlUrl ( new Uri ( " https://localhost:5005/static/index.html " )),
106- new BffFrontend ( BffFrontendName . Parse ( " admin-frontend " ))
107- . WithIndexHtmlUrl ( new Uri ( " https://localhost:5005/ admin/index.html " ))
108- );
109-
110- // ...existing code for authentication, authorization, etc.`
111- ```
100+ < Code
101+ lang = " csharp "
102+ title = " Program.cs "
103+ code = { ` builder.Services.AddBff()
104+ .AddFrontends(
105+ new BffFrontend(BffFrontendName.Parse("default-frontend"))
106+ .WithIndexHtmlUrl( new Uri("https://localhost:5005/static/index.html")),
107+ new BffFrontend(BffFrontendName.Parse(" admin-frontend "))
108+ .WithIndexHtmlUrl(new Uri("https://localhost:5005/admin/index.html"))
109+ );
110+
111+ // ...existing code for authentication, authorization, etc. ` } />
112112
113113 </TabItem >
114114 { /* prettier-ignore */ }
@@ -117,42 +117,42 @@ app.Run();
117117
118118 Example ` bffconfig.json ` :
119119
120- ``` json
121- {
122- "defaultOidcSettings" : null ,
123- "defaultCookieSettings " : null ,
124- "frontends " : {
125- "from_config " : {
126- "indexHtmlUrl " : " https://localhost:5005/static/index.html " ,
127- "matchingPath " : " /from-config " ,
128- "oidc " : {
129- "clientId " : " bff.multi-frontend.config "
130- },
131- "remoteApis" : [
132- {
133- "localPath" : " /api/client-token " ,
134- "targetUri " : " https://localhost:5010 " ,
135- "tokenRequirement " : " Client "
136- }
137- ]
138- }
120+ < Code
121+ lang = " json "
122+ code = { ` {
123+ "defaultOidcSettings ": null,
124+ "defaultCookieSettings ": null,
125+ "frontends ": {
126+ "from_config ": {
127+ "indexHtmlUrl ": "https://localhost:5005/static/index.html ",
128+ "matchingPath ": "/from-config",
129+ "oidc ": {
130+ "clientId": "bff.multi-frontend.config"
131+ },
132+ "remoteApis": [
133+ {
134+ "localPath ": "/api/client-token ",
135+ "targetUri ": "https://localhost:5010",
136+ "tokenRequirement": "Client"
137+ }
138+ ]
139139 }
140140 }
141- ```
141+ } ` } />
142142
143143 Load and use the configuration in ` Program.cs ` :
144144
145- ``` csharp
146- // Program.cs
147- var bffConfig = new ConfigurationBuilder ()
148- .AddJsonFile (" bffconfig.json" )
149- .Build ();
150-
151- builder .Services .AddBff ()
152- .LoadConfiguration (bffConfig );
145+ <Code
146+ lang = " csharp"
147+ title = " Program.cs"
148+ code = { ` var bffConfig = new ConfigurationBuilder()
149+ .AddJsonFile("bffconfig.json")
150+ .Build();
153151
154- // ...existing code for authentication, authorization, etc.
155- ```
152+ builder.Services.AddBff()
153+ .LoadConfiguration(bffConfig);
154+
155+ // ...existing code for authentication, authorization, etc. ` } />
156156
157157 </TabItem >
158158</Tabs >
@@ -168,16 +168,16 @@ You can configure remote API proxying in two ways:
168168- ** Direct proxying per frontend:**
169169 You can configure remote APIs for each frontend individually:
170170
171- ``` csharp
172- // Program.cs
173- builder .Services .AddBff ()
174- .AddFrontends (
175- new BffFrontend (BffFrontendName .Parse (" default-frontend" ))
176- .WithIndexHtmlUrl (new Uri (" https://localhost:5005/static/index.html" ))
177- .WithRemoteApis (
178- new RemoteApi (LocalPath .Parse (" /api/user-token" ), new Uri (" https://localhost:5010" ))
179- )
180- );
171+ ``` csharp
172+ // Program.cs
173+ builder .Services .AddBff ()
174+ .AddFrontends (
175+ new BffFrontend (BffFrontendName .Parse (" default-frontend" ))
176+ .WithIndexHtmlUrl (new Uri (" https://localhost:5005/static/index.html" ))
177+ .WithRemoteApis (
178+ new RemoteApi (LocalPath .Parse (" /api/user-token" ), new Uri (" https://localhost:5010" ))
179+ )
180+ );
181181 ```
182182
183183This allows each frontend to have its own set of proxied remote APIs.
0 commit comments