-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cs
More file actions
39 lines (33 loc) · 946 Bytes
/
main.cs
File metadata and controls
39 lines (33 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using NotKyle.WebServer;
using NotKyle.Logger;
namespace ConsoleWebServer
{
class Program
{
static void Main(string[] args)
{
bool running = false;
do
{
Logger.Log("Server is not running, automatically starting.");
try
{
Server.Start();
running = true;
Logger.Log("Server started successfully, press Ctrl+C to stop.");
while (running)
{
Console.ReadKey();
}
}
catch (Exception e)
{
Logger.Log($"Failed to start server: {e.Message}");
Logger.Log("Press any key to try again...");
Console.ReadKey();
}
} while (!running);
}
}
}