This commit is contained in:
24
docs/snippets/api_server/csharp.md
Normal file
24
docs/snippets/api_server/csharp.md
Normal file
@@ -0,0 +1,24 @@
|
||||
```csharp title="C#"
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
class ApiServer
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
var processInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "kreuzberg",
|
||||
Arguments = "serve -H 0.0.0.0 -p 8000",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true
|
||||
};
|
||||
|
||||
using (var process = Process.Start(processInfo))
|
||||
{
|
||||
process?.WaitForExit();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user