This repository was archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathProgram.cs
More file actions
46 lines (33 loc) · 1.3 KB
/
Program.cs
File metadata and controls
46 lines (33 loc) · 1.3 KB
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
39
40
41
42
43
44
45
46
namespace ConsoleExample
{
using System;
using Netty;
/// <summary>
/// A class that provides an entry point for the application.
/// </summary>
public class Program
{
/// <summary>
/// Defines the entry point of the application.
/// </summary>
/// <param name="args">The command-line arguments passed to the application.</param>
public static void Main(string[] args)
{
Console.Write("Starting Web Server ... ");
// Setup a new web server using a random port. The ports can be shared as long as
// the virtual path is unique.
var webServer = new NettyServer(@"..\..\..\SampleWebsite", "/Sample/");
// Update an application setting, and then start the server
webServer
.AlterApplicationSetting("Key1", "I am updated.")
.Start();
Console.WriteLine("Done.");
Console.WriteLine("Listening at: {0}", webServer.Port);
Console.WriteLine("Press [ENTER] to exit.");
Console.ReadLine();
// Stop the web server - this will restore the configuration to the original values
Console.WriteLine("Stopping Web Server ... ");
webServer.Stop();
}
}
}