Skip to content

Commit 0341e9b

Browse files
authored
Update README.md
1 parent 4b83e5f commit 0341e9b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,35 @@ public object Map(string code, string customer)
126126
public string Name { get; set; } = "admin";
127127
}
128128
```
129+
### Windows service
130+
``` csharp
131+
class Program
132+
{
133+
private static HttpServer mServer;
134+
135+
static void Main(string[] args)
136+
{
137+
mServer = new HttpServer(80);
138+
mServer.IsWindowsServices = true;
139+
mServer.Setting((service, option) =>
140+
{
141+
option.LogToConsole = true;
142+
option.WriteLog = true;
143+
option.LogLevel = BeetleX.EventArgs.LogType.Info;
144+
});
145+
mServer.RegisterComponent<Home>();
146+
mServer.Run();
147+
}
148+
}
149+
[Controller]
150+
public class Home
151+
{
152+
public object Hello(string name)
153+
{
154+
return $"hello {name}";
155+
}
156+
}
157+
```
129158
### EntityFrameworkCore extensions
130159
`BeetleX.FastHttpApi.EFCore.Extension `
131160
``` csharp

0 commit comments

Comments
 (0)