Skip to content

Instantly share code, notes, and snippets.

@igloo15
Created November 7, 2016 15:59
Show Gist options
  • Save igloo15/a53620005c32bbd482055d736830c740 to your computer and use it in GitHub Desktop.
Save igloo15/a53620005c32bbd482055d736830c740 to your computer and use it in GitHub Desktop.
The main entry for program.cs
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