12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using Microsoft.AspNetCore;
- using Microsoft.AspNetCore.Hosting;
- namespace vCloud.Server.Videos
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- try
- {
- if (args.Length > 0)
- {
- var port = args[1];
- BuildWebHost($"*:{port}").Run();
- }
- else
- {
- BuildWebHost("*:9107").Run();
- }
- }
- catch (Exception exception)
- {
- Console.WriteLine($"build web host failed, error: {exception.Message}");
- Console.ReadLine();
- }
- }
- private static IWebHost BuildWebHost(string serverUrl) =>
- WebHost.CreateDefaultBuilder()
- .UseKestrel()
- .UseUrls($"http://{serverUrl}")
- .UseStartup<Startup>()
- .Build();
- }
- }
|