Created
November 7, 2016 15:59
-
-
Save igloo15/a53620005c32bbd482055d736830c740 to your computer and use it in GitHub Desktop.
The main entry for program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using WebServer.Main; | |
namespace WebServerRunner | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
string contentPath = Directory.GetCurrentDirectory(); | |
string webRoot = ""; | |
string port = "1515"; | |
if(args.Length > 0) | |
{ | |
contentPath = args[0]; | |
if(args.Length > 1) | |
{ | |
port = args[1]; | |
if(args.Length > 2) | |
{ | |
webRoot = args[2]; | |
} | |
} | |
} | |
var myServer = new Server(contentPath, port, webRoot); | |
myServer.Start(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment