-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from unosquare/DropSystemNew
Full support to WebSockets in all runtimes
- Loading branch information
Showing
71 changed files
with
9,140 additions
and
465 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,41 +5,47 @@ | |
|
||
internal class Program | ||
{ | ||
public static readonly bool IsMono = Type.GetType("Mono.Runtime") != null; | ||
|
||
/// <summary> | ||
/// Defines the entry point of the application. | ||
/// </summary> | ||
/// <param name="args">The arguments.</param> | ||
private static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Running at MONO: {0}", IsMono); | ||
|
||
var url = "http://localhost:9696/"; | ||
|
||
if (args.Length > 0) | ||
url = args[0]; | ||
|
||
var dbContext = new AppDbContext(); | ||
#if !MONO | ||
var dbContext = new AppDbContext(); | ||
|
||
foreach (var person in dbContext.People.SelectAll()) | ||
dbContext.People.Delete(person); | ||
foreach (var person in dbContext.People.SelectAll()) | ||
dbContext.People.Delete(person); | ||
|
||
dbContext.People.Insert(new Person() | ||
{ | ||
Name = "Mario Di Vece", | ||
Age = 31, | ||
EmailAddress = "[email protected]" | ||
}); | ||
dbContext.People.Insert(new Person() | ||
{ | ||
Name = "Geovanni Perez", | ||
Age = 32, | ||
EmailAddress = "[email protected]" | ||
}); | ||
dbContext.People.Insert(new Person() | ||
{ | ||
Name = "Mario Di Vece", | ||
Age = 31, | ||
EmailAddress = "[email protected]" | ||
}); | ||
dbContext.People.Insert(new Person() | ||
{ | ||
Name = "Geovanni Perez", | ||
Age = 32, | ||
EmailAddress = "[email protected]" | ||
}); | ||
|
||
dbContext.People.Insert(new Person() | ||
{ | ||
Name = "Luis Gonzalez", | ||
Age = 29, | ||
EmailAddress = "[email protected]" | ||
}); | ||
dbContext.People.Insert(new Person() | ||
{ | ||
Name = "Luis Gonzalez", | ||
Age = 29, | ||
EmailAddress = "[email protected]" | ||
}); | ||
#endif | ||
|
||
// Our web server is disposable. Note that if you don't want to use logging, | ||
// there are alternate constructors that allow you to skip specifying an ILog object. | ||
|
@@ -64,17 +70,15 @@ private static void Main(string[] args) | |
|
||
// Register the static files server. See the html folder of this project. Also notice that | ||
// the files under the html folder have Copy To Output Folder = Copy if Newer | ||
StaticFilesSample.Setup(server); | ||
StaticFilesSample.Setup(server, !IsMono); | ||
|
||
// Register the Web Api Module. See the Setup method to find out how to do it | ||
// It registers the WebApiModule and registers the controller(s) -- that's all. | ||
server.WithWebApiController<PeopleController>(); | ||
|
||
#if NET452 | ||
|
||
// Register the WebSockets module. See the Setup method to find out how to do it | ||
// It registers the WebSocketsModule and registers the server for the given paths(s) | ||
WebSocketsSample.Setup(server); | ||
#endif | ||
|
||
// Once we've registered our modules and configured them, we call the Run() method. | ||
// This is a non-blocking method (it return immediately) so in this case we avoid | ||
|
@@ -84,7 +88,7 @@ private static void Main(string[] args) | |
|
||
// Fire up the browser to show the content! | ||
#if DEBUG | ||
#if NET452 | ||
#if !NETCOREAPP1_0 | ||
var browser = new System.Diagnostics.Process() | ||
{ | ||
StartInfo = new System.Diagnostics.ProcessStartInfo(url) | ||
|
This file contains 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
138 changes: 138 additions & 0 deletions
138
src/Unosquare.Labs.EmbedIO.Samples/Unosquare.Labs.EmbedIO.Samples.csproj
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{A45D13E0-4138-41A1-9C42-8F6BB9474BA6}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Unosquare.Labs.EmbedIO.Samples</RootNamespace> | ||
<AssemblyName>Unosquare.Labs.EmbedIO.Samples</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>TRACE;DEBUG;MONO</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.ComponentModel.DataAnnotations" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="AppDbContext.cs" /> | ||
<Compile Include="PeopleController.cs" /> | ||
<Compile Include="Person.cs" /> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="StaticFilesSample.cs" /> | ||
<Compile Include="WebSocketsSample.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="html\css\embedio-icon.png"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\css\embedio.png"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\css\theme.css"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\favicon.ico"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\index.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\partials\app-menu.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\partials\app-person.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\app.controllers.js"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\app.directives.js"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\app.js"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\app.routes.js"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\app.services.js"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\tubular\tubular-bundle.css"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\tubular\tubular-bundle.js"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\tubular\tubular-bundle.min.css"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\scripts\tubular\tubular-bundle.min.js"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\views\chat.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\views\cmd.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\views\home.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\views\people.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="html\views\tubular.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Unosquare.Labs.EmbedIO\Unosquare.Labs.EmbedIO.csproj"> | ||
<Project>{7d7c29b4-9493-4ebd-8f20-6fac1e7161ee}</Project> | ||
<Name>Unosquare.Labs.EmbedIO</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="app.config" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
Oops, something went wrong.