Skip to content

Commit 68e66a5

Browse files
committed
refactor(documentation): update
1 parent ebadb62 commit 68e66a5

3 files changed

Lines changed: 7 additions & 46 deletions

File tree

documentation/simplew/docs/guide/getting-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The following minimal example can be used for rapid prototyping :
2727

2828
::: code-group
2929

30-
```csharp [Program.cs]
30+
```csharp:line-numbers [Program.cs]
3131
using System;
3232
using System.Net;
3333
using SimpleW;
@@ -73,7 +73,7 @@ The following example builds a REST API with clear routing using a structured co
7373

7474
::: code-group
7575

76-
```csharp [Program.cs]
76+
```csharp:line-numbers [Program.cs]
7777
using System.Net;
7878
using SimpleW;
7979
using SimpleW.Observability;
@@ -100,7 +100,7 @@ namespace Sample {
100100
}
101101
```
102102

103-
```csharp [TestController.cs]
103+
```csharp:line-numbers [TestController.cs]
104104
using System.Net;
105105
using SimpleW;
106106
@@ -135,7 +135,7 @@ The following example serves static files from your `c:\www` directory.
135135

136136
::: code-group
137137

138-
```csharp [Program.cs]
138+
```csharp:line-numbers [Program.cs]
139139
using System;
140140
using System.Net;
141141
using SimpleW;
@@ -192,7 +192,7 @@ The following example serves both static files from your `c:\www` directory and
192192

193193
::: code-group
194194

195-
```csharp [Program.cs]
195+
```csharp:line-numbers [Program.cs]
196196
using System;
197197
using System.Net;
198198
using SimpleW;
@@ -229,7 +229,7 @@ namespace Sample {
229229
}
230230
```
231231

232-
```csharp [TestController.cs]
232+
```csharp:line-numbers [TestController.cs]
233233
using System;
234234
using System.Net;
235235
using SimpleW;

documentation/simplew/docs/guide/server.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ using SimpleW;
2424

2525
var server1 = new SimpleWServer(IPAddress.Loopback, 8080);
2626

27-
var endpoint = new IPEndPoint(IPAddress.Any, 8081);
28-
var server2 = new SimpleWServer(endpoint);
27+
var server2 = new SimpleWServer(new IPEndPoint(IPAddress.Any, 8081));
2928
```
3029

3130

documentation/simplew/docs/index.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -140,42 +140,4 @@ public class TestController : Controller {
140140
}
141141
```
142142

143-
```csharp:line-numbers [ASP.NET-like]
144-
var builder = SimpleWHost.CreateApplicationBuilder(args)
145-
.UseMicrosoftLogging();
146-
147-
builder.ConfigureSimpleW(server => {
148-
configureApp: server => {
149-
// razor
150-
server.UseRazorModule(options => {
151-
options.ViewsPath = "Views";
152-
});
153-
// OpenAPI JSON
154-
server.MapGet("/swagger.json", static (HttpSession session) => {
155-
return Swagger.Json(session);
156-
});
157-
// Swagger UI
158-
server.MapGet("/swagger", static (HttpSession session) => {
159-
return Swagger.UI(session);
160-
});
161-
// routes
162-
server.MapGet("/hello", () => {
163-
return new { message = "Hello World !" };
164-
});
165-
// ssl
166-
X509Certificate2 cert = new(@"/app/ssl/domain.pfx", "password");
167-
var sslcontext = new SslContext(SslProtocols.Tls12 | SslProtocols.Tls13, cert, clientCertificateRequired: false, checkCertificateRevocation: false);
168-
server.UseHttps(sslcontext);
169-
},
170-
configureServer: options => {
171-
options.TcpNoDelay = true;
172-
options.ReuseAddress = true;
173-
options.TcpKeepAlive = true;
174-
}
175-
});
176-
177-
var host = builder.Build();
178-
await host.RunAsync();
179-
```
180-
181143
:::

0 commit comments

Comments
 (0)