From 13155d53495061b7a7c9f033817663ca55b826ce Mon Sep 17 00:00:00 2001 From: Tom Gardham-Pallister Date: Wed, 29 Jun 2016 21:33:51 +0100 Subject: [PATCH] initial commit with some basic ideas --- src/Ocelot.ApiGateway/.gitignore | 234 ++++++++++++++++++ src/Ocelot.ApiGateway/AddRouteHandler.cs | 19 ++ src/Ocelot.ApiGateway/Dockerfile | 11 + src/Ocelot.ApiGateway/Program.cs | 21 ++ .../Properties/launchSettings.json | 28 +++ src/Ocelot.ApiGateway/Routers.cs | 24 ++ src/Ocelot.ApiGateway/Startup.cs | 44 ++++ src/Ocelot.ApiGateway/appsettings.json | 10 + src/Ocelot.ApiGateway/project.json | 61 +++++ src/Ocelot.ApiGateway/web.config | 14 ++ src/Ocelot.Library/.gitignore | 234 ++++++++++++++++++ src/Ocelot.Library/RouterMiddleware.cs | 16 ++ src/Ocelot.Library/project.json | 17 ++ test/Ocelot.UnitTests/.gitignore | 234 ++++++++++++++++++ test/Ocelot.UnitTests/RouterMiddlwareTests.cs | 16 ++ test/Ocelot.UnitTests/project.json | 21 ++ 16 files changed, 1004 insertions(+) create mode 100644 src/Ocelot.ApiGateway/.gitignore create mode 100644 src/Ocelot.ApiGateway/AddRouteHandler.cs create mode 100644 src/Ocelot.ApiGateway/Dockerfile create mode 100644 src/Ocelot.ApiGateway/Program.cs create mode 100644 src/Ocelot.ApiGateway/Properties/launchSettings.json create mode 100644 src/Ocelot.ApiGateway/Routers.cs create mode 100644 src/Ocelot.ApiGateway/Startup.cs create mode 100755 src/Ocelot.ApiGateway/appsettings.json create mode 100644 src/Ocelot.ApiGateway/project.json create mode 100644 src/Ocelot.ApiGateway/web.config create mode 100644 src/Ocelot.Library/.gitignore create mode 100644 src/Ocelot.Library/RouterMiddleware.cs create mode 100644 src/Ocelot.Library/project.json create mode 100644 test/Ocelot.UnitTests/.gitignore create mode 100644 test/Ocelot.UnitTests/RouterMiddlwareTests.cs create mode 100644 test/Ocelot.UnitTests/project.json diff --git a/src/Ocelot.ApiGateway/.gitignore b/src/Ocelot.ApiGateway/.gitignore new file mode 100644 index 00000000..0ca27f04 --- /dev/null +++ b/src/Ocelot.ApiGateway/.gitignore @@ -0,0 +1,234 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/src/Ocelot.ApiGateway/AddRouteHandler.cs b/src/Ocelot.ApiGateway/AddRouteHandler.cs new file mode 100644 index 00000000..baaa05a4 --- /dev/null +++ b/src/Ocelot.ApiGateway/AddRouteHandler.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.DependencyInjection; + +namespace Ocelot.ApiGateway +{ + public static class HelloExtensions + { + public static IRouteBuilder AddRouter(this IRouteBuilder routeBuilder, + IApplicationBuilder app) + { + routeBuilder.Routes.Add(new Route(new Router(), + "{*url}", + app.ApplicationServices.GetService())); + + return routeBuilder; + } + } +} \ No newline at end of file diff --git a/src/Ocelot.ApiGateway/Dockerfile b/src/Ocelot.ApiGateway/Dockerfile new file mode 100644 index 00000000..5ea50452 --- /dev/null +++ b/src/Ocelot.ApiGateway/Dockerfile @@ -0,0 +1,11 @@ +FROM microsoft/aspnet:1.0.0-rc1-update1 + +RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list +RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* + +COPY . /app +WORKDIR /app +RUN ["dnu", "restore"] + +EXPOSE 5000/tcp +ENTRYPOINT ["dnx", "-p", "project.json", "Microsoft.AspNet.Server.Kestrel", "--server.urls", "http://0.0.0.0:5000"] diff --git a/src/Ocelot.ApiGateway/Program.cs b/src/Ocelot.ApiGateway/Program.cs new file mode 100644 index 00000000..b5404270 --- /dev/null +++ b/src/Ocelot.ApiGateway/Program.cs @@ -0,0 +1,21 @@ +using System.IO; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Builder; + +namespace Ocelot.ApiGateway +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/src/Ocelot.ApiGateway/Properties/launchSettings.json b/src/Ocelot.ApiGateway/Properties/launchSettings.json new file mode 100644 index 00000000..3f72d44b --- /dev/null +++ b/src/Ocelot.ApiGateway/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:55368/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName" : "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables" : { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Ocelot.ApiGateway": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000/api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/Ocelot.ApiGateway/Routers.cs b/src/Ocelot.ApiGateway/Routers.cs new file mode 100644 index 00000000..af8881bc --- /dev/null +++ b/src/Ocelot.ApiGateway/Routers.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Routing; + +namespace Ocelot.ApiGateway +{ + public class Router : IRouter + { + public Task RouteAsync(RouteContext context) + { + context.Handler = async c => + { + await c.Response.WriteAsync($"Hi, Tom!"); + }; + + return Task.FromResult(0); + } + + public VirtualPathData GetVirtualPath(VirtualPathContext context) + { + return null; + } + } +} \ No newline at end of file diff --git a/src/Ocelot.ApiGateway/Startup.cs b/src/Ocelot.ApiGateway/Startup.cs new file mode 100644 index 00000000..c3c49020 --- /dev/null +++ b/src/Ocelot.ApiGateway/Startup.cs @@ -0,0 +1,44 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Routing; + +namespace Ocelot.ApiGateway +{ + public class Startup + { + public Startup(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); + Configuration = builder.Build(); + } + + public IConfigurationRoot Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddRouting(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + + loggerFactory.AddDebug(); + + var routeBuilder = new RouteBuilder(app); + + routeBuilder.AddRouter(app); + + app.UseRouter(routeBuilder.Build()); + } + } +} diff --git a/src/Ocelot.ApiGateway/appsettings.json b/src/Ocelot.ApiGateway/appsettings.json new file mode 100755 index 00000000..cb1818e7 --- /dev/null +++ b/src/Ocelot.ApiGateway/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/Ocelot.ApiGateway/project.json b/src/Ocelot.ApiGateway/project.json new file mode 100644 index 00000000..05f7e266 --- /dev/null +++ b/src/Ocelot.ApiGateway/project.json @@ -0,0 +1,61 @@ +{ + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-rc2-3002702", + "type": "platform" + }, + "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Routing": "1.0.0-rc2-final" + }, + + "tools": { + "Microsoft.AspNetCore.Server.IISIntegration.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + } + }, + + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "dotnet5.6", + "dnxcore50", + "portable-net45+win8" + ] + } + }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "gcServer": true + }, + + "publishOptions": { + "include": [ + "wwwroot", + "Views", + "appsettings.json", + "web.config" + ] + }, + + "scripts": { + "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + }, + + "tooling": { + "defaultNamespace": "Ocelot.ApiGateway" + } +} diff --git a/src/Ocelot.ApiGateway/web.config b/src/Ocelot.ApiGateway/web.config new file mode 100644 index 00000000..68ab630e --- /dev/null +++ b/src/Ocelot.ApiGateway/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/src/Ocelot.Library/.gitignore b/src/Ocelot.Library/.gitignore new file mode 100644 index 00000000..0ca27f04 --- /dev/null +++ b/src/Ocelot.Library/.gitignore @@ -0,0 +1,234 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/src/Ocelot.Library/RouterMiddleware.cs b/src/Ocelot.Library/RouterMiddleware.cs new file mode 100644 index 00000000..d4474325 --- /dev/null +++ b/src/Ocelot.Library/RouterMiddleware.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Ocelot.Library +{ + // This project can output the Class library as a NuGet Package. + // To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build". + public class RouterMiddleware + { + public RouterMiddleware() + { + } + } +} diff --git a/src/Ocelot.Library/project.json b/src/Ocelot.Library/project.json new file mode 100644 index 00000000..b72a5c6a --- /dev/null +++ b/src/Ocelot.Library/project.json @@ -0,0 +1,17 @@ +{ + "version": "1.0.0-*", + + "dependencies": { + "NETStandard.Library": "1.5.0-rc2-24027" + }, + + "frameworks": { + "netstandard1.5": { + "imports": "dnxcore50" + } + }, + + "tooling": { + "defaultNamespace": "Ocelot.Library" + } +} diff --git a/test/Ocelot.UnitTests/.gitignore b/test/Ocelot.UnitTests/.gitignore new file mode 100644 index 00000000..0ca27f04 --- /dev/null +++ b/test/Ocelot.UnitTests/.gitignore @@ -0,0 +1,234 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/test/Ocelot.UnitTests/RouterMiddlwareTests.cs b/test/Ocelot.UnitTests/RouterMiddlwareTests.cs new file mode 100644 index 00000000..42fca0cb --- /dev/null +++ b/test/Ocelot.UnitTests/RouterMiddlwareTests.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Ocelot.UnitTests +{ + // This project can output the Class library as a NuGet Package. + // To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build". + public class RouterMiddlwareTests + { + public RouterMiddlwareTests() + { + } + } +} diff --git a/test/Ocelot.UnitTests/project.json b/test/Ocelot.UnitTests/project.json new file mode 100644 index 00000000..ae4974e0 --- /dev/null +++ b/test/Ocelot.UnitTests/project.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.0-*", + + "dependencies": { + "NETStandard.Library": "1.5.0-rc2-24027", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Routing": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final" + }, + + "frameworks": { + "netstandard1.5": { + "imports": "dnxcore50" + } + }, + + "tooling": { + "defaultNamespace": "Ocelot.UnitTests" + } +}